[−][src]Struct async_value::Async
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]
closure: impl FnOnce(&Stale) -> CResult<T> + Send + 'static
) -> Async<T>
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]
&mut self,
fun: impl FnOnce(Result<&mut T, AError>, &Stale) -> CResult<()> + Send + 'static
) -> AResult<()>
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(&self) -> 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
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,