pub struct OptionalKeyPath<Root, Value, F>{ /* private fields */ }Implementations§
Source§impl<Root, Value, F> OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> OptionalKeyPath<Root, Value, F>
pub fn new(getter: F) -> Self
pub fn get<'r>(&self, root: &'r Root) -> Option<&'r Value>
pub fn then<SubValue, G>( self, next: OptionalKeyPath<Value, SubValue, G>, ) -> OptionalKeyPath<Root, SubValue, impl for<'r> Fn(&'r Root) -> Option<&'r SubValue>>
pub fn for_box<Target>(
self,
) -> OptionalKeyPath<Root, Target, impl for<'r> Fn(&'r Root) -> Option<&'r Target> + 'static>where
Value: Deref<Target = Target> + 'static,
F: 'static,
pub fn for_arc<Target>(
self,
) -> OptionalKeyPath<Root, Target, impl for<'r> Fn(&'r Root) -> Option<&'r Target> + 'static>where
Value: Deref<Target = Target> + 'static,
F: 'static,
pub fn for_rc<Target>(
self,
) -> OptionalKeyPath<Root, Target, impl for<'r> Fn(&'r Root) -> Option<&'r Target> + 'static>where
Value: Deref<Target = Target> + 'static,
F: 'static,
pub fn for_option<T>() -> OptionalKeyPath<Option<T>, T, impl for<'r> Fn(&'r Option<T>) -> Option<&'r T>>
Source§impl<Root, Value, F> OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> OptionalKeyPath<Root, Value, F>
Sourcepub fn to_partial(self) -> PartialOptionalKeyPath<Root>
pub fn to_partial(self) -> PartialOptionalKeyPath<Root>
Convert to PartialOptionalKeyPath (hides Value type)
Sourcepub fn to_any(self) -> AnyKeyPath
pub fn to_any(self) -> AnyKeyPath
Convert to AnyKeyPath (hides both Root and Value types)
Sourcepub fn to(self) -> PartialOptionalKeyPath<Root>
pub fn to(self) -> PartialOptionalKeyPath<Root>
Convert to PartialOptionalKeyPath (alias for to_partial())
Trait Implementations§
Source§impl<Root: Clone, Value: Clone, F> Clone for OptionalKeyPath<Root, Value, F>
impl<Root: Clone, Value: Clone, F> Clone for OptionalKeyPath<Root, Value, F>
Source§fn clone(&self) -> OptionalKeyPath<Root, Value, F>
fn clone(&self) -> OptionalKeyPath<Root, Value, F>
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<Root, Value, F> Freeze for OptionalKeyPath<Root, Value, F>where
F: Freeze,
impl<Root, Value, F> RefUnwindSafe for OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> Send for OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> Sync for OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> Unpin for OptionalKeyPath<Root, Value, F>
impl<Root, Value, F> UnwindSafe for OptionalKeyPath<Root, Value, F>
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