summaryrefslogtreecommitdiffstats
path: root/src/io/task.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-08-31 00:19:29 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-08-31 19:00:42 -0700
commit330ab823b0dfe45c0f4219e1601ecbbdd5ae457b (patch)
tree48e67b5fcf4213a141ef68b15195afa5837827e0 /src/io/task.rs
parent440a813c5ac23b07528dd710a9301f5e5c64126d (diff)
Update to futures master
* Remove `LoopData` as it's no longer necessary * Add `LoopHandle::spawn` to spawn new futures onto an event loop * Add `LoopData::spawn` to also spawn new futures onto an event loop * Rejigger the implementation of the event loop a bit (make a slab of futures), but otherwise everything else is pretty constant.
Diffstat (limited to 'src/io/task.rs')
-rw-r--r--src/io/task.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/io/task.rs b/src/io/task.rs
index 3c87a32e..e7b42a49 100644
--- a/src/io/task.rs
+++ b/src/io/task.rs
@@ -1,7 +1,7 @@
use std::cell::RefCell;
use std::io::{self, Read, Write};
-use futures::task::TaskData;
+use futures::task::TaskRc;
/// Abstraction that allows inserting an I/O object into task-local storage,
/// returning a handle that can be split.
@@ -15,7 +15,7 @@ use futures::task::TaskData;
/// polled, will pin the yielded `TaskIo<T>` object to that specific task. Any
/// attempt to read or write the object on other tasks will result in a panic.
pub struct TaskIo<T> {
- handle: TaskData<RefCell<T>>,
+ handle: TaskRc<RefCell<T>>,
}
/// The readable half of a `TaskIo<T>` instance returned from `TaskIo::split`.
@@ -23,7 +23,7 @@ pub struct TaskIo<T> {
/// This handle implements the `ReadTask` trait and can be used to split up an
/// I/O object into two distinct halves.
pub struct TaskIoRead<T> {
- handle: TaskData<RefCell<T>>,
+ handle: TaskRc<RefCell<T>>,
}
/// The writable half of a `TaskIo<T>` instance returned from `TaskIo::split`.
@@ -31,7 +31,7 @@ pub struct TaskIoRead<T> {
/// This handle implements the `WriteTask` trait and can be used to split up an
/// I/O object into two distinct halves.
pub struct TaskIoWrite<T> {
- handle: TaskData<RefCell<T>>,
+ handle: TaskRc<RefCell<T>>,
}
impl<T> TaskIo<T> {
@@ -41,7 +41,7 @@ impl<T> TaskIo<T> {
/// The returned future will never resolve to an error.
pub fn new(t: T) -> TaskIo<T> {
TaskIo {
- handle: TaskData::new(RefCell::new(t)),
+ handle: TaskRc::new(RefCell::new(t)),
}
}
}