Struct async_nursery::Nursery [−][src]
pub struct Nursery<S, Out> { /* fields omitted */ }
Expand description
The sender part of the nursery. Wraps an unbounded sender. Can be cloned.
To manage the spawned tasks and await their output, see NurseryStream
.
Will disconnect on drop. You can close all senders by calling close_nursery
.
Implementations
Create a new nursery. Returns a tuple of the sender part and the stream of outputs.
Stop this nursery and any clones from accepting any more tasks. Calling this or
dropping all Nursery
is necessary for the stream impl of NurseryStream
to end
and return None
.
Trait Implementations
impl<S, Out> LocalNurse<Out> for Nursery<S, Out> where
S: LocalSpawnHandle<Out>,
Out: 'static,
[src]
impl<S, Out> LocalNurse<Out> for Nursery<S, Out> where
S: LocalSpawnHandle<Out>,
Out: 'static,
[src]Spawn a !Send
future and store it’s JoinHandle.
Spawns a future that will be run to completion. Read more
fn status_local(&self) -> Result<(), SpawnError>
fn status_local(&self) -> Result<(), SpawnError>
Determines whether the executor is able to spawn new tasks. Read more
impl<S, Out> Sink<FutureObj<'static, Out>> for Nursery<S, Out> where
S: SpawnHandle<Out>,
Out: 'static + Send,
[src]
impl<S, Out> Sink<FutureObj<'static, Out>> for Nursery<S, Out> where
S: SpawnHandle<Out>,
Out: 'static + Send,
[src]This is a no-op. If you want to disconnect, just drop this Nursery
. If you want to
close the NurseryStream, call Nursery::close_nursery
.
Attempts to prepare the Sink
to receive a value. Read more
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
impl<S, Out> Sink<LocalFutureObj<'static, Out>> for Nursery<S, Out> where
S: LocalSpawnHandle<Out>,
Out: 'static,
[src]
impl<S, Out> Sink<LocalFutureObj<'static, Out>> for Nursery<S, Out> where
S: LocalSpawnHandle<Out>,
Out: 'static,
[src]This is a no-op. If you want to disconnect, just drop this Nursery
. If you want to
close the NurseryStream, call Nursery::close_nursery
.
Attempts to prepare the Sink
to receive a value. Read more
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
Auto Trait Implementations
impl<S, Out> !RefUnwindSafe for Nursery<S, Out>
impl<S, Out> !UnwindSafe for Nursery<S, Out>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<Sp> LocalSpawnExt for Sp where
Sp: LocalSpawn + ?Sized,
impl<Sp> LocalSpawnExt for Sp where
Sp: LocalSpawn + ?Sized,
impl<T, Item> SinkExt<Item> for T where
T: Sink<Item> + ?Sized,
impl<T, Item> SinkExt<Item> for T where
T: Sink<Item> + ?Sized,
Composes a function in front of the sink. Read more
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F> where
F: FnMut(U) -> St,
St: Stream<Item = Result<Item, Self::Error>>,
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F> where
F: FnMut(U) -> St,
St: Stream<Item = Result<Item, Self::Error>>,
Composes a function in front of the sink. Read more
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
Transforms the error returned by the sink.
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E> where
Self::Error: Into<E>,
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E> where
Self::Error: Into<E>,
Map this sink’s error to a different error type using the Into
trait. Read more
Adds a fixed-size buffer to the current sink. Read more
Fanout items to multiple sinks. Read more
Flush the sink, processing all pending items. Read more
A future that completes after the given item has been fully processed into the sink, including flushing. Read more
A future that completes after the given item has been received by the sink. Read more
A future that completes after the given stream has been fully processed into the sink, including flushing. Read more
fn left_sink<Si2>(self) -> Either<Self, Si2> where
Si2: Sink<Item, Error = Self::Error>,
fn left_sink<Si2>(self) -> Either<Self, Si2> where
Si2: Sink<Item, Error = Self::Error>,
Wrap this sink in an Either
sink, making it the left-hand variant
of that Either
. Read more
fn right_sink<Si1>(self) -> Either<Si1, Self> where
Si1: Sink<Item, Error = Self::Error>,
fn right_sink<Si1>(self) -> Either<Si1, Self> where
Si1: Sink<Item, Error = Self::Error>,
Wrap this stream in an Either
stream, making it the right-hand variant
of that Either
. Read more
fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error> where
Self: Unpin,
fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error> where
Self: Unpin,
impl<Sp> SpawnExt for Sp where
Sp: Spawn + ?Sized,
impl<Sp> SpawnExt for Sp where
Sp: Spawn + ?Sized,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more