summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-01-21 16:46:23 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-01-21 16:46:23 +0000
commit9e6e42297a35bfb0a8cb3bfa08a5b395a04ac0dc (patch)
treef789fd09d48a60897ae0461c37b51e5767ee0634 /src/lib.rs
parent5f321db0196669b60f1ef4bcaf44d28238565077 (diff)
parentc3ff37b0942f527295a7213f44eee13bf2590ddf (diff)
downloadnix-9e6e42297a35bfb0a8cb3bfa08a5b395a04ac0dc.zip
Merge #820
820: Change AioCb to primarily use Bytes instead of Rc<[u8]> r=Susurrus a=asomers `Rc<[u8]>` isn't a very good buffer type to use for aio. For one thing, it lacks interior mutability. For another, a single `Rc<[u8]>` can't be carved up into smaller buffers of the same type. `Bytes` and `BytesMut` fix both problems. This PR removes the ability to construct an `AioCb` from `Rc<[u8]>` and adds the ability to construct one from `Bytes`, `BytesMut`, or raw pointers (for consumers who need even more flexibility). At this stage, the PR has the following warts: 1. A hack is necessary to force small `Bytes` buffers to allocate on the heap. I plan to fix this with an enhancement to the bytes crate. 2. The `AioCb::buffer` method is necessary due to a deficiency in the tokio-core crate. Once I fix that, then only `AioCb::into_buffer`will need to be public.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 08e98580..5aaebc40 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,6 +11,7 @@
#![cfg_attr(test, deny(warnings))]
#![recursion_limit = "500"]
+extern crate bytes;
#[macro_use]
extern crate bitflags;