pub struct UseFuture<T> { /* private fields */ }
Implementations§
§impl<T> UseFuture<T>
impl<T> UseFuture<T>
pub fn restart(&self)
pub fn restart(&self)
Restart the future with new dependencies.
Will not cancel the previous future, but will ignore any values that it generates.
pub fn cancel(&self, cx: &ScopeState)
pub fn cancel(&self, cx: &ScopeState)
Forcefully cancel a future
pub fn clear(&self) -> Option<T>
pub fn set(&self, _new_value: T)
pub fn value(&self) -> Option<&T>
pub fn value(&self) -> Option<&T>
Return any value, even old values if the future has not yet resolved.
If the future has never completed, the returned value will be None
.
pub fn state(&self) -> UseFutureState<'_, T>
pub fn state(&self) -> UseFutureState<'_, T>
Get the current state of the future.
Trait Implementations§
§impl<'a, T> IntoFuture for &'a UseFuture<T>
impl<'a, T> IntoFuture for &'a UseFuture<T>
§type IntoFuture = UseFutureAwait<'a, T>
type IntoFuture = UseFutureAwait<'a, T>
Which kind of future are we turning this into?
§fn into_future(self) -> <&'a UseFuture<T> as IntoFuture>::IntoFuture
fn into_future(self) -> <&'a UseFuture<T> as IntoFuture>::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<T> !RefUnwindSafe for UseFuture<T>
impl<T> !Send for UseFuture<T>
impl<T> !Sync for UseFuture<T>
impl<T> Unpin for UseFuture<T>
impl<T> !UnwindSafe for UseFuture<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