pub struct StaticPool<I, W, R>where
    W: Worker<I>,
    R: Reducer<W::Output>,{ /* private fields */ }
Expand description

StaticPool is a pool with a static concurrency limit.

Implementations§

source§

impl<I, W, R> StaticPool<I, W, R>where I: Send + 'static, W: Worker<I> + Send + Sync + 'static, W::Output: Send, R: Reducer<W::Output> + Send + 'static, R::Output: Send + Sync,

source

pub fn add(&self, input: I)

Add a work item to be done by the pool.

source

pub fn wait_handle(self) -> WaitHandle<R::Output>

Return a wait handle. This indicates that no new work will be added to the pool and wait() can be invoked on the returned handle to wait for all input to be processed and retrieve the output value.

source

pub fn wait(self) -> R::Output

Wait for all input to be processed and return the output value.

Trait Implementations§

source§

impl<I: Debug, W, R> Debug for StaticPool<I, W, R>where W: Worker<I> + Debug, R: Reducer<W::Output> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I, W, R> Pool<I> for StaticPool<I, W, R>where I: Send + 'static, W: Worker<I> + Send + Sync + 'static, R: Reducer<W::Output> + Send + 'static, R::Output: Send + Sync,

§

type Output = <R as Reducer<<W as Worker<I>>::Output>>::Output

§

type WaitHandle = WaitHandle<<R as Reducer<<W as Worker<I>>::Output>>::Output>

source§

fn add(&self, input: I)

source§

fn wait_handle(self) -> Self::WaitHandle

source§

fn wait(self) -> R::Output

Auto Trait Implementations§

§

impl<I, W, R> !RefUnwindSafe for StaticPool<I, W, R>

§

impl<I, W, R> Send for StaticPool<I, W, R>where I: Send, R: Send, W: Send,

§

impl<I, W, R> Sync for StaticPool<I, W, R>where I: Send, R: Send, W: Sync,

§

impl<I, W, R> Unpin for StaticPool<I, W, R>where W: Unpin,

§

impl<I, W, R> !UnwindSafe for StaticPool<I, W, R>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.