[][src]Struct async_value::Async

pub struct Async<T: Send + 'static> {
    pub value: AResult<T>,
    // some fields omitted
}

Fields

value: AResult<T>

Methods

impl<T: Send + 'static> Async<T>[src]

pub fn new(
    closure: impl FnOnce(&Stale) -> CResult<T> + Send + 'static
) -> Async<T>
[src]

pub fn new_with_value(val: T) -> Async<T>[src]

pub fn run_sync(self) -> AResult<T>[src]

pub fn run(&mut self) -> AResult<()>[src]

pub fn run_pooled(&mut self, pool: Option<&ThreadPool>) -> AResult<()>[src]

pub fn set_stale(&mut self) -> AResult<()>[src]

pub fn set_fresh(&self) -> AResult<()>[src]

pub fn is_stale(&self) -> AResult<bool>[src]

pub fn get_stale(&self) -> Stale[src]

pub fn put_stale(&mut self, stale: Stale)[src]

pub fn is_running(&self) -> bool[src]

pub fn is_ready(&self) -> bool[src]

pub fn set_sleeping(&self)[src]

pub fn set_running(&self)[src]

pub fn set_ready(&self)[src]

pub fn set_failed(&self)[src]

pub fn pull_async(&mut self) -> AResult<()>[src]

pub fn get(&self) -> AResult<&T>[src]

pub fn get_mut(&mut self) -> AResult<&mut T>[src]

pub fn on_ready(
    &mut self,
    fun: impl FnOnce(Result<&mut T, AError>, &Stale) -> CResult<()> + Send + 'static
) -> AResult<()>
[src]

pub fn set_default_thread_pool(pool: Option<ThreadPool>) -> AResult<()>[src]

pub fn new_default_thread_pool() -> AResult<()>[src]

Trait Implementations

impl<T: Clone + Send + 'static> Clone for Async<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Send + Debug> Debug for Async<T>[src]

Auto Trait Implementations

impl<T> Send for Async<T>

impl<T> Sync for Async<T> where
    T: Sync

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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