pub struct StateBinding<S: 'static> { /* private fields */ }Expand description
Read/write access to store state without cloning S.
Implementations§
Source§impl<S: 'static> StateBinding<S>
impl<S: 'static> StateBinding<S>
Sourcepub fn with_mut<R>(&self, f: impl FnOnce(&mut S) -> R) -> R
pub fn with_mut<R>(&self, f: impl FnOnce(&mut S) -> R) -> R
Mutably borrow the root state under the lock.
Sourcepub fn project<V, SK>(&self, kp: SK) -> ProjectedBinding<S, V, SK>where
SK: RefKpTrait<S, V>,
pub fn project<V, SK>(&self, kp: SK) -> ProjectedBinding<S, V, SK>where
SK: RefKpTrait<S, V>,
Project a property via keypath — reads/writes go to the original binding’s state.
Trait Implementations§
Source§impl<S: Clone + 'static> Clone for StateBinding<S>
impl<S: Clone + 'static> Clone for StateBinding<S>
Source§fn clone(&self) -> StateBinding<S>
fn clone(&self) -> StateBinding<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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<S> !RefUnwindSafe for StateBinding<S>
impl<S> !UnwindSafe for StateBinding<S>
impl<S> Freeze for StateBinding<S>
impl<S> Send for StateBinding<S>where
S: Send,
impl<S> Sync for StateBinding<S>where
S: Send,
impl<S> Unpin for StateBinding<S>
impl<S> UnsafeUnpin for StateBinding<S>
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