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