[][src]Struct lofi::Conduit

pub struct Conduit { /* fields omitted */ }

A conduit that allows access to a state provided in Executor::tick().

Use Executor::get_conduit() to create.

Implementations

impl Conduit[src]

pub fn with<T, F, R>(&self, action: F) -> R where
    T: UniversalTypeId,
    F: FnOnce(&T) -> R, 
[src]

Perform action on a tick state state immutably accessed by this conduit.

pub async fn with_mut<T, F, R>(self, action: F) -> R where
    T: UniversalTypeId,
    F: FnOnce(&mut T) -> R, 
[src]

Perform action on the state exclusively accessed by this conduit.

Returns a future that, upon awaiting on it, puts the fiber into an "exclusive access" mode, guaranteeing that no other fibers are using a tick state.

pub fn spawn<F>(self, task: F) where
    F: Future<Output = ()> + Send + Sync + 'static, 
[src]

Spawn a new future in current executor.

pub fn spawn_ret<F, T>(self, task: F) -> JoinHandle<T>

Notable traits for JoinHandle<T>

impl<T: Send + 'static> Future for JoinHandle<T> type Output = T;
where
    F: Future<Output = T> + Send + Sync + 'static,
    T: Send + 'static, 
[src]

Spawn a new future in current executor. Allows awaiting for completion.

Trait Implementations

impl Clone for Conduit[src]

impl Copy for Conduit[src]

Auto Trait Implementations

impl RefUnwindSafe for Conduit

impl Send for Conduit

impl Sync for Conduit

impl Unpin for Conduit

impl UnwindSafe for Conduit

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.