Trait drone_core::fib::ThrFiberClosure[][src]

pub trait ThrFiberClosure: ThrToken {
    fn add_fn<F, R>(self, f: F)
    where
        F: FnMut() -> FiberState<(), R>,
        F: Send + 'static,
        R: ReturnNone
, { ... }
fn add_fn_factory<C, F, R>(self, factory: C)
    where
        C: FnOnce() -> F + Send + 'static,
        F: FnMut() -> FiberState<(), R>,
        F: 'static,
        R: ReturnNone
, { ... }
fn add_once<F>(self, f: F)
    where
        F: FnOnce(),
        F: Unpin + Send + 'static
, { ... } }

Extends ThrToken types with add_fn, add_fn_factory, and add_once methods.

Provided methods

fn add_fn<F, R>(self, f: F) where
    F: FnMut() -> FiberState<(), R>,
    F: Send + 'static,
    R: ReturnNone, 
[src]

Adds a fiber that runs the closure f until FiberState::Complete is returned.

fn add_fn_factory<C, F, R>(self, factory: C) where
    C: FnOnce() -> F + Send + 'static,
    F: FnMut() -> FiberState<(), R>,
    F: 'static,
    R: ReturnNone, 
[src]

Adds a fiber that runs the closure returned by factory until FiberState::Complete is returned.

This method is useful for non-Send fibers.

fn add_once<F>(self, f: F) where
    F: FnOnce(),
    F: Unpin + Send + 'static, 
[src]

Adds a fiber that calls the closure f once.

Loading content...

Implementors

impl<T: ThrToken> ThrFiberClosure for T[src]

Loading content...