pub struct Async<T: Send + 'static> {
pub value: AResult<T>,
/* private fields */
}Fields§
§value: AResult<T>Implementations§
Source§impl<T: Send + 'static> Async<T>
impl<T: Send + 'static> Async<T>
pub fn new( closure: impl FnOnce(&Stale) -> CResult<T> + Send + 'static, ) -> Async<T>
pub fn new_with_value(val: T) -> Async<T>
pub fn run_sync(self) -> AResult<T>
pub fn run(&mut self) -> AResult<()>
pub fn run_pooled(&mut self, pool: Option<&ThreadPool>) -> AResult<()>
pub fn set_stale(&mut self) -> AResult<()>
pub fn set_fresh(&self) -> AResult<()>
pub fn is_stale(&self) -> AResult<bool>
pub fn get_stale(&self) -> Stale
pub fn put_stale(&mut self, stale: Stale)
pub fn is_running(&self) -> bool
pub fn is_ready(&self) -> bool
pub fn set_sleeping(&self)
pub fn set_running(&self)
pub fn set_ready(&self)
pub fn set_failed(&self)
pub fn pull_async(&mut self) -> AResult<()>
pub fn get(&self) -> AResult<&T>
pub fn get_mut(&mut self) -> AResult<&mut T>
pub fn on_ready( &mut self, fun: impl FnOnce(Result<&mut T, AError>, &Stale) -> CResult<()> + Send + 'static, ) -> AResult<()>
pub fn set_default_thread_pool(pool: Option<ThreadPool>) -> AResult<()>
pub fn new_default_thread_pool() -> AResult<()>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Async<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Async<T>
impl<T> Send for Async<T>
impl<T> Sync for Async<T>where
T: Sync,
impl<T> Unpin for Async<T>where
T: Unpin,
impl<T> UnsafeUnpin for Async<T>where
T: UnsafeUnpin,
impl<T> !UnwindSafe for Async<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more