Struct async_backplane::Device [−][src]
pub struct Device { /* fields omitted */ }
Expand description
A Device connects a Future to the backplane.
Implementations
Notify our peers we’re disconnecting.
Link with another Device with the provided LinkMode. LinkModes are additive, so you can ‘upgrade’ a link this way.
This method is intended for static-style linking, where the topology is not expected to change. You should not link to a Device this way after linking to it through a Line.
Unlink from another Device with the provided LinkMode. LinkModes are subtractive, so you can ‘downgrade’ a link this way.
This method is intended for static-style linking, where the topology is not expected to change. You should not link to a Device this way after linking to it through a Line.
Link with a line. This is safer than linking directly to a Device, but a little slower.
Unlink with a line. This is safer than linking directly to a Device, but a little slower.
Attempts to get the next message. Does not wait for one to arrive.
Returns the first of (with a bias towards the former):
- The next message to be received.
- The result of the completed future.
- The crash of the Device.
Runs an async closure while monitoring for messages. Messages are handled as follows:
- Disconnects without fault are ignored.
- Disconnects with fault cause the Device to fault.
- Requests to disconnect cause the Device to crash but announce a successful completion.
If the provided closure returns successfully, the result is returned along with the Device for re-use. Monitors will not be notified.
If the Device faults, either because the provided closure returned an Err variant or because a fault was propagated, announces our fault to our monitors.
Trait Implementations
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read more
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Retrieves the next item in the stream. Read more
Counts the number of elements in the stream. Read more
Maps items of the stream to new values using a closure. Read more
Keeps items of the stream for which predicate
returns true
. Read more
Filters and maps items of the stream using a closure. Read more
Collects all items in the stream into a collection. Read more
fn try_collect<T, C>(self) -> TryCollectFuture<Self, C> where
C: Default + Extend<T>,
Self::Item: Result,
<Self::Item as Result>::Ok == T,
fn try_collect<T, C>(self) -> TryCollectFuture<Self, C> where
C: Default + Extend<T>,
Self::Item: Result,
<Self::Item as Result>::Ok == T,
Collects all items in the fallible stream into a collection. Read more
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
Accumulates a computation over the stream. Read more
Accumulates a fallible computation over the stream. Read more
Boxes the stream and changes its type to dyn Stream<Item = T> + Send
. Read more