pub enum PartialKeyPath<Root> {
Readable(Arc<dyn for<'a> Fn(&'a Root) -> &'a (dyn Any + Send + Sync) + Send + Sync>),
ReadableEnum {
extract: Arc<dyn for<'a> Fn(&'a Root) -> Option<&'a (dyn Any + Send + Sync)> + Send + Sync>,
embed: Arc<dyn Fn(Box<dyn Any>) -> Root + Send + Sync>,
},
FailableReadable(Arc<dyn for<'a> Fn(&'a Root) -> Option<&'a (dyn Any + Send + Sync)> + Send + Sync>),
Writable(Arc<dyn for<'a> Fn(&'a mut Root) -> &'a mut (dyn Any + Send + Sync) + Send + Sync>),
FailableWritable(Arc<dyn for<'a> Fn(&'a mut Root) -> Option<&'a mut (dyn Any + Send + Sync)> + Send + Sync>),
WritableEnum {
extract: Arc<dyn for<'a> Fn(&'a Root) -> Option<&'a (dyn Any + Send + Sync)> + Send + Sync>,
extract_mut: Arc<dyn for<'a> Fn(&'a mut Root) -> Option<&'a mut (dyn Any + Send + Sync)> + Send + Sync>,
embed: Arc<dyn Fn(Box<dyn Any>) -> Root + Send + Sync>,
},
ReferenceWritable(Arc<dyn for<'a> Fn(&'a mut Root) -> &'a mut (dyn Any + Send + Sync) + Send + Sync>),
Owned(Arc<dyn Fn(Root) -> Box<dyn Any> + Send + Sync>),
FailableOwned(Arc<dyn Fn(Root) -> Option<Box<dyn Any>> + Send + Sync>),
FailableCombined {
readable: Arc<dyn for<'a> Fn(&'a Root) -> Option<&'a (dyn Any + Send + Sync)> + Send + Sync>,
writable: Arc<dyn for<'a> Fn(&'a mut Root) -> Option<&'a mut (dyn Any + Send + Sync)> + Send + Sync>,
owned: Arc<dyn Fn(Root) -> Option<Box<dyn Any>> + Send + Sync>,
},
}Expand description
PartialKeyPath
Variants§
Readable(Arc<dyn for<'a> Fn(&'a Root) -> &'a (dyn Any + Send + Sync) + Send + Sync>)
ReadableEnum
Fields
FailableReadable(Arc<dyn for<'a> Fn(&'a Root) -> Option<&'a (dyn Any + Send + Sync)> + Send + Sync>)
Writable(Arc<dyn for<'a> Fn(&'a mut Root) -> &'a mut (dyn Any + Send + Sync) + Send + Sync>)
FailableWritable(Arc<dyn for<'a> Fn(&'a mut Root) -> Option<&'a mut (dyn Any + Send + Sync)> + Send + Sync>)
WritableEnum
Fields
ReferenceWritable(Arc<dyn for<'a> Fn(&'a mut Root) -> &'a mut (dyn Any + Send + Sync) + Send + Sync>)
Owned(Arc<dyn Fn(Root) -> Box<dyn Any> + Send + Sync>)
FailableOwned(Arc<dyn Fn(Root) -> Option<Box<dyn Any>> + Send + Sync>)
FailableCombined
Implementations§
Source§impl<Root> PartialKeyPath<Root>
impl<Root> PartialKeyPath<Root>
Sourcepub fn get<'a>(&'a self, root: &'a Root) -> Option<&'a (dyn Any + Send + Sync)>
pub fn get<'a>(&'a self, root: &'a Root) -> Option<&'a (dyn Any + Send + Sync)>
Get an immutable reference if possible
Sourcepub fn get_mut<'a>(
&'a self,
root: &'a mut Root,
) -> Option<&'a mut (dyn Any + Send + Sync)>
pub fn get_mut<'a>( &'a self, root: &'a mut Root, ) -> Option<&'a mut (dyn Any + Send + Sync)>
Get a mutable reference if possible
Sourcepub fn get_owned(self, root: Root) -> Box<dyn Any>
pub fn get_owned(self, root: Root) -> Box<dyn Any>
Get an owned value (primary method for owned keypaths)
Sourcepub fn get_failable_owned(self, root: Root) -> Option<Box<dyn Any>>
pub fn get_failable_owned(self, root: Root) -> Option<Box<dyn Any>>
Get an owned value with failable access
Sourcepub fn to_any(self) -> AnyKeyPathwhere
Root: 'static,
pub fn to_any(self) -> AnyKeyPathwhere
Root: 'static,
Convert this PartialKeyPath to an AnyKeyPath (fully type-erased)
Sourcepub fn for_arc(self) -> PartialKeyPath<Arc<Root>>where
Root: 'static + Clone,
pub fn for_arc(self) -> PartialKeyPath<Arc<Root>>where
Root: 'static + Clone,
Adapt this PartialKeyPath to work with Arc
Sourcepub fn for_box(self) -> PartialKeyPath<Box<Root>>where
Root: 'static,
pub fn for_box(self) -> PartialKeyPath<Box<Root>>where
Root: 'static,
Adapt this PartialKeyPath to work with Box
Sourcepub fn for_rc(self) -> PartialKeyPath<Rc<Root>>where
Root: 'static + Clone,
pub fn for_rc(self) -> PartialKeyPath<Rc<Root>>where
Root: 'static + Clone,
Adapt this PartialKeyPath to work with Rc
Sourcepub fn for_result<E>(self) -> PartialKeyPath<Result<Root, E>>where
Root: 'static,
pub fn for_result<E>(self) -> PartialKeyPath<Result<Root, E>>where
Root: 'static,
Adapt this PartialKeyPath to work with Result<Root, E>
Sourcepub fn for_option(self) -> PartialKeyPath<Option<Root>>where
Root: 'static,
pub fn for_option(self) -> PartialKeyPath<Option<Root>>where
Root: 'static,
Adapt this PartialKeyPath to work with Option
Sourcepub fn for_arc_rwlock(self) -> PartialKeyPath<Arc<RwLock<Root>>>where
Root: 'static + Clone,
pub fn for_arc_rwlock(self) -> PartialKeyPath<Arc<RwLock<Root>>>where
Root: 'static + Clone,
Adapt this PartialKeyPath to work with Arc<RwLock
Sourcepub fn for_arc_mutex(self) -> PartialKeyPath<Arc<Mutex<Root>>>where
Root: 'static + Clone,
pub fn for_arc_mutex(self) -> PartialKeyPath<Arc<Mutex<Root>>>where
Root: 'static + Clone,
Adapt this PartialKeyPath to work with Arc<Mutex
Trait Implementations§
Source§impl<Root: Clone> Clone for PartialKeyPath<Root>
impl<Root: Clone> Clone for PartialKeyPath<Root>
Source§fn clone(&self) -> PartialKeyPath<Root>
fn clone(&self) -> PartialKeyPath<Root>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more