pub struct StreamMap<ID, O> { /* private fields */ }Expand description
Represents a map of Streams.
Each stream must finish within the specified time and the map never outgrows its capacity.
Implementations§
Source§impl<ID, O> StreamMap<ID, O>
impl<ID, O> StreamMap<ID, O>
Sourcepub fn try_push<F>(
&mut self,
id: ID,
stream: F,
) -> Result<(), PushError<Pin<Box<dyn AnyStream<Item = O> + Send>>>>where
F: AnyStream<Item = O>,
pub fn try_push<F>(
&mut self,
id: ID,
stream: F,
) -> Result<(), PushError<Pin<Box<dyn AnyStream<Item = O> + Send>>>>where
F: AnyStream<Item = O>,
Push a stream into the map.
pub fn remove( &mut self, id: ID, ) -> Option<Pin<Box<dyn AnyStream<Item = O> + Send>>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn poll_ready_unpin(&mut self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_next_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<(ID, Option<Result<O, Timeout>>)>
Sourcepub fn iter_of_type<T>(&self) -> impl Iterator<Item = (&ID, Pin<&T>)>where
T: 'static,
pub fn iter_of_type<T>(&self) -> impl Iterator<Item = (&ID, Pin<&T>)>where
T: 'static,
Returns an iterator over all streams of type T pushed via StreamMap::try_push.
This iterator returns streams in an arbitrary order, which may change.
If downcasting a stream to T fails it will be skipped in the iterator.
Sourcepub fn iter_mut_of_type<T>(
&mut self,
) -> impl Iterator<Item = (&ID, Pin<&mut T>)>where
T: 'static,
pub fn iter_mut_of_type<T>(
&mut self,
) -> impl Iterator<Item = (&ID, Pin<&mut T>)>where
T: 'static,
Returns an iterator with mutable access over all streams of type T
pushed via StreamMap::try_push.
This iterator returns streams in an arbitrary order, which may change.
If downcasting a stream to T fails it will be skipped in the iterator.
Auto Trait Implementations§
impl<ID, O> !Freeze for StreamMap<ID, O>
impl<ID, O> !RefUnwindSafe for StreamMap<ID, O>
impl<ID, O> !Sync for StreamMap<ID, O>
impl<ID, O> !UnwindSafe for StreamMap<ID, O>
impl<ID, O> Send for StreamMap<ID, O>
impl<ID, O> Unpin for StreamMap<ID, O>
impl<ID, O> UnsafeUnpin for StreamMap<ID, O>where
SelectAll<TaggedStream<ID, TimeoutStream<Pin<Box<dyn AnyStream<Item = O> + Send>>>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more