Struct futures_bounded::StreamMap

source ·
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>
where ID: Clone + Unpin,

source

pub fn new(timeout: Duration, capacity: usize) -> Self

source§

impl<ID, O> StreamMap<ID, O>
where ID: Clone + PartialEq + Send + Unpin + 'static, O: Send + 'static,

source

pub fn try_push<F>( &mut self, id: ID, stream: F ) -> Result<(), PushError<BoxStream<'_, O>>>
where F: Stream<Item = O> + Send + 'static,

Push a stream into the map.

source

pub fn remove(&mut self, id: ID) -> Option<BoxStream<'static, O>>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn poll_ready_unpin(&mut self, cx: &mut Context<'_>) -> Poll<()>

source

pub fn poll_next_unpin( &mut self, cx: &mut Context<'_> ) -> Poll<(ID, Option<Result<O, Timeout>>)>

Auto Trait Implementations§

§

impl<ID, O> !Freeze for StreamMap<ID, O>

§

impl<ID, O> !RefUnwindSafe for StreamMap<ID, O>

§

impl<ID, O> Send for StreamMap<ID, O>
where ID: Send,

§

impl<ID, O> !Sync for StreamMap<ID, O>

§

impl<ID, O> Unpin for StreamMap<ID, O>

§

impl<ID, O> !UnwindSafe for StreamMap<ID, O>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.