Struct dioxus_hooks::UseFuture
source · pub struct UseFuture<T: 'static> { /* private fields */ }
Implementations§
source§impl<T> UseFuture<T>
impl<T> UseFuture<T>
sourcepub 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.
sourcepub fn cancel(&self, cx: &ScopeState)
pub fn cancel(&self, cx: &ScopeState)
Forcefully cancel a future
pub fn set(&self, new_value: T)
sourcepub 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
.
sourcepub fn state(&self) -> UseFutureState<'_, T>
pub fn state(&self) -> UseFutureState<'_, T>
Get the current state of the future.
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