[][src]Struct smartpool::channel::MultiChannel

pub struct MultiChannel<Inner: Channel> { /* fields omitted */ }

A round-robin multi channel wrapper.

Methods

impl<Inner: Channel> MultiChannel<Inner>[src]

pub fn from_vec(inner: Vec<Inner>) -> Self[src]

pub fn new(
    count: usize,
    factory: impl Fn() -> Inner
) -> Self
[src]

Trait Implementations

impl<Inner: Channel> Channel for MultiChannel<Inner>[src]

fn into_shared(self) -> Arc<RwLock<Self>> where
    Self: Sized
[src]

Wrap self in a reference counted read/write lock, which is still a channel, and can have shared ownership, allowing it to be used in a scheduler. Read more

impl<Inner: Channel + Exec> Exec for MultiChannel<Inner>[src]

fn exec(
    &self,
    future: impl Future<Item = (), Error = ()> + Send + 'static
)
[src]

Execute a future on this channel.

fn exec_push<I: Send + 'static, E: Send + 'static>(
    &self,
    future: impl Future<Item = I, Error = E> + Send + 'static
) -> PushFutureRecv<I, E>
[src]

Execute a future on this channel, and push the result to a push future.

impl<Inner: Channel + ExecParam> ExecParam for MultiChannel<Inner>[src]

type Param = Inner::Param

fn exec(
    &self,
    future: impl Future<Item = (), Error = ()> + Send + 'static,
    param: Self::Param
)
[src]

Execute a future on this channel.

fn exec_push<I: Send + 'static, E: Send + 'static>(
    &self,
    future: impl Future<Item = I, Error = E> + Send + 'static,
    param: Self::Param
) -> PushFutureRecv<I, E>
[src]

Execute a future on this channel, and push the result to a push future.

Auto Trait Implementations

impl<Inner> Send for MultiChannel<Inner> where
    Inner: Send

impl<Inner> Sync for MultiChannel<Inner> where
    Inner: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.