Struct futures_bounded::StreamSet

source ·
pub struct StreamSet<O> { /* private fields */ }
Expand description

Represents a set of Streams.

Each stream must finish within the specified time and the list never outgrows its capacity.

Implementations§

source§

impl<O> StreamSet<O>

source

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

source§

impl<O> StreamSet<O>
where O: Send + 'static,

source

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

Push a stream into the list.

This method adds the given stream to the list. If the length of the list is equal to the capacity, this method returns a error that contains the passed stream. In that case, the stream is not added to the set.

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<Option<Result<O, Timeout>>>

Auto Trait Implementations§

§

impl<O> !Freeze for StreamSet<O>

§

impl<O> !RefUnwindSafe for StreamSet<O>

§

impl<O> Send for StreamSet<O>

§

impl<O> !Sync for StreamSet<O>

§

impl<O> Unpin for StreamSet<O>

§

impl<O> !UnwindSafe for StreamSet<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.