pub enum Updater<T> {
Value(T),
Func(Arc<dyn Fn(&T) -> T + Sync + Send>),
}Expand description
TanStack-style updater: either a value replacement or a function of the previous value.
Variants§
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Updater<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Updater<T>
impl<T> Send for Updater<T>where
T: Send,
impl<T> Sync for Updater<T>where
T: Sync,
impl<T> Unpin for Updater<T>where
T: Unpin,
impl<T> UnsafeUnpin for Updater<T>where
T: UnsafeUnpin,
impl<T> !UnwindSafe for Updater<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