pub struct PartialWritableOptionalKeyPath<Root> { /* private fields */ }Expand description
PartialWritableOptionalKeyPath - Hides the Value type but keeps Root visible (writable optional)
§Why PhantomData?
See PartialKeyPath documentation for explanation of why PhantomData is needed.
Implementations§
Source§impl<Root> PartialWritableOptionalKeyPath<Root>
impl<Root> PartialWritableOptionalKeyPath<Root>
pub fn new<Value>(
keypath: WritableOptionalKeyPath<Root, Value, impl for<'r> Fn(&'r mut Root) -> Option<&'r mut Value> + 'static>,
) -> Selfwhere
Value: Any + 'static,
Root: 'static,
pub fn get_mut<'r>(&self, root: &'r mut Root) -> Option<&'r mut dyn Any>
Sourcepub fn value_type_id(&self) -> TypeId
pub fn value_type_id(&self) -> TypeId
Get the TypeId of the Value type
Sourcepub fn get_mut_as<'a, Value: Any>(
&self,
root: &'a mut Root,
) -> Option<Option<&'a mut Value>>
pub fn get_mut_as<'a, Value: Any>( &self, root: &'a mut Root, ) -> Option<Option<&'a mut Value>>
Try to downcast the result to a specific type
Trait Implementations§
Source§impl<Root: Clone> Clone for PartialWritableOptionalKeyPath<Root>
impl<Root: Clone> Clone for PartialWritableOptionalKeyPath<Root>
Source§fn clone(&self) -> PartialWritableOptionalKeyPath<Root>
fn clone(&self) -> PartialWritableOptionalKeyPath<Root>
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> Freeze for PartialWritableOptionalKeyPath<Root>
impl<Root> !RefUnwindSafe for PartialWritableOptionalKeyPath<Root>
impl<Root> !Send for PartialWritableOptionalKeyPath<Root>
impl<Root> !Sync for PartialWritableOptionalKeyPath<Root>
impl<Root> Unpin for PartialWritableOptionalKeyPath<Root>where
Root: Unpin,
impl<Root> !UnwindSafe for PartialWritableOptionalKeyPath<Root>
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