pub struct DerivedState<T> { /* private fields */ }Expand description
A value computed from other states, which tells its readers only when the result
changes. Compose’s derivedStateOf.
A list that changes on every keystroke and a screen that only cares whether the list is empty is the case it is for: the screen observes the derived boolean, and the boolean is recomputed on every change but only runs the screen again when it flips.
It belongs to the UI thread. Remember it, so it is computed once per change rather than once per composition.
Implementations§
Trait Implementations§
Source§impl<T> Clone for DerivedState<T>
impl<T> Clone for DerivedState<T>
Source§impl<T> PartialEq for DerivedState<T>
impl<T> PartialEq for DerivedState<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DerivedState<T>
impl<T> !Send for DerivedState<T>
impl<T> !Sync for DerivedState<T>
impl<T> !UnwindSafe for DerivedState<T>
impl<T> Freeze for DerivedState<T>
impl<T> Unpin for DerivedState<T>
impl<T> UnsafeUnpin for DerivedState<T>where
Rc<DerivedCell<T>>: UnsafeUnpin,
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