pub struct OwnedMutableState<T: Clone + 'static> { /* private fields */ }Expand description
Owning state handle for reclaimable state cells.
Implementations§
Source§impl<T: Clone + 'static> OwnedMutableState<T>
impl<T: Clone + 'static> OwnedMutableState<T>
pub fn with_runtime(value: T, runtime: RuntimeHandle) -> Self
pub fn handle(&self) -> MutableState<T>
pub fn as_state(&self) -> State<T>
Methods from Deref<Target = MutableState<T>>§
pub fn is_alive(&self) -> bool
pub fn try_with<R>(&self, f: impl FnOnce(&T) -> R) -> Option<R>
pub fn try_value(&self) -> Option<T>
pub fn as_state(&self) -> State<T>
pub fn try_retain(&self) -> Option<OwnedMutableState<T>>
pub fn retain(&self) -> OwnedMutableState<T>
pub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R
pub fn update<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
pub fn replace(&self, value: T)
pub fn set_value(&self, value: T)
pub fn set(&self, value: T)
pub fn value(&self) -> T
pub fn get(&self) -> T
pub fn get_non_reactive(&self) -> T
Trait Implementations§
Source§impl<T: Clone + Clone + 'static> Clone for OwnedMutableState<T>
impl<T: Clone + Clone + 'static> Clone for OwnedMutableState<T>
Source§fn clone(&self) -> OwnedMutableState<T>
fn clone(&self) -> OwnedMutableState<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for OwnedMutableState<T>
impl<T> !RefUnwindSafe for OwnedMutableState<T>
impl<T> !Send for OwnedMutableState<T>
impl<T> !Sync for OwnedMutableState<T>
impl<T> Unpin for OwnedMutableState<T>
impl<T> UnsafeUnpin for OwnedMutableState<T>
impl<T> !UnwindSafe for OwnedMutableState<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