pub struct WritableKeyPath<Root, Value> {
pub get: Box<dyn for<'a> Fn(&'a Root) -> &'a Value>,
pub get_mut: Box<dyn for<'a> Fn(&'a mut Root) -> &'a mut Value>,
}
Fields§
§get: Box<dyn for<'a> Fn(&'a Root) -> &'a Value>
§get_mut: Box<dyn for<'a> Fn(&'a mut Root) -> &'a mut Value>
Implementations§
Source§impl<Root, Value> WritableKeyPath<Root, Value>
impl<Root, Value> WritableKeyPath<Root, Value>
pub fn new( get: impl for<'a> Fn(&'a Root) -> &'a Value + 'static, get_mut: impl for<'a> Fn(&'a mut Root) -> &'a mut Value + 'static, ) -> WritableKeyPath<Root, Value>
pub fn try_get<'a>(&self, root: &'a Root) -> &'a Value
pub fn try_get_mut<'a>(&self, root: &'a mut Root) -> &'a mut Value
Sourcepub fn iter<'a>(
&'a self,
slice: &'a [Root],
) -> impl Iterator<Item = &'a Value> + 'a
pub fn iter<'a>( &'a self, slice: &'a [Root], ) -> impl Iterator<Item = &'a Value> + 'a
Mutable iteration
Sourcepub fn iter_mut<'a>(
&'a self,
slice: &'a mut [Root],
) -> impl Iterator<Item = &'a mut Value> + 'a
pub fn iter_mut<'a>( &'a self, slice: &'a mut [Root], ) -> impl Iterator<Item = &'a mut Value> + 'a
Mutable iteration
Source§impl<Root, Mid> WritableKeyPath<Root, Mid>where
Root: 'static,
Mid: 'static,
impl<Root, Mid> WritableKeyPath<Root, Mid>where
Root: 'static,
Mid: 'static,
pub fn compose<Value>(
self,
mid: WritableKeyPath<Mid, Value>,
) -> WritableKeyPath<Root, Value>where
Value: 'static,
Auto Trait Implementations§
impl<Root, Value> Freeze for WritableKeyPath<Root, Value>
impl<Root, Value> !RefUnwindSafe for WritableKeyPath<Root, Value>
impl<Root, Value> !Send for WritableKeyPath<Root, Value>
impl<Root, Value> !Sync for WritableKeyPath<Root, Value>
impl<Root, Value> Unpin for WritableKeyPath<Root, Value>
impl<Root, Value> !UnwindSafe for WritableKeyPath<Root, Value>
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