Struct tiny_future::Getter
source · [−]pub struct Getter<T> { /* private fields */ }
Expand description
A getter for a future
Implementations
sourceimpl<T> Getter<T>
impl<T> Getter<T>
sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the future has been cancelled or not
sourcepub fn wait(self) -> Option<T>
pub fn wait(self) -> Option<T>
Waits until the result is ready, returns either Some(result)
if the future has completed successfully or None
if the future has been cancelled
sourcepub fn wait_timeout(self, timeout: Duration) -> Result<Option<T>, Self>
pub fn wait_timeout(self, timeout: Duration) -> Result<Option<T>, Self>
Waits until a result is available or the timeout is reached
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Getter<T>
impl<T> Send for Getter<T> where
T: Send,
impl<T> Sync for Getter<T> where
T: Send,
impl<T> Unpin for Getter<T>
impl<T> UnwindSafe for Getter<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more