Type Definition dbcrossbarlib::tokio_glue::BoxFuture

source ·
pub type BoxFuture<T, E = Error> = BoxFuture<'static, Result<T, E>>;
Expand description

Standard future type for this library. Like Result, but used by async. We mark it as Send to ensure it can be sent between threads safely (even when blocked on .await!), and we Pin<Box<...>> it using .boxed() to make it an abstract, heap-based type, for convenience. All we know is that it will return a Result<T>.

Trait Implementations§

source§

impl<T: Send + Sized + 'static> ConsumeWithParallelism<T> for BoxStream<BoxFuture<T>>

source§

fn consume_with_parallelism(self, parallelism: usize) -> BoxFuture<Vec<T>>

Consume futures from the stream, running parallelism futures at any given time.