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>,
) -> PartialWritableOptionalKeyPath<Root>where
Value: Any + 'static,
Root: 'static,
pub fn get_mut<'r>( &self, root: &'r mut Root, ) -> Option<&'r mut (dyn Any + 'static)>
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>(
&self,
root: &'a mut Root,
) -> Option<Option<&'a mut Value>>where
Value: Any,
pub fn get_mut_as<'a, Value>(
&self,
root: &'a mut Root,
) -> Option<Option<&'a mut Value>>where
Value: Any,
Try to downcast the result to a specific type
Trait Implementations§
Source§impl<Root> Clone for PartialWritableOptionalKeyPath<Root>where
Root: Clone,
impl<Root> Clone for PartialWritableOptionalKeyPath<Root>where
Root: Clone,
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 moreSource§impl<Root> From<PartialWritableOptionalKeyPath<Root>> for PKP<Root>
impl<Root> From<PartialWritableOptionalKeyPath<Root>> for PKP<Root>
Source§fn from(kp: RustPartialWritableOptionalKeyPath<Root>) -> Self
fn from(kp: RustPartialWritableOptionalKeyPath<Root>) -> Self
Converts to this type from the input type.
Auto 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