pub enum PKP<Root> {
PartialKeyPath(PartialKeyPath<Root>),
PartialOptionalKeyPath(PartialOptionalKeyPath<Root>),
PartialWritableKeyPath(PartialWritableKeyPath<Root>),
PartialWritableOptionalKeyPath(PartialWritableOptionalKeyPath<Root>),
}Expand description
Enum for partial keypath types (PartialKeyPath, PartialOptionalKeyPath, PartialWritableKeyPath, PartialWritableOptionalKeyPath).
Provides syntactic sugar for functions accepting any partial keypath type.
§Example
ⓘ
fn process_partial_keypath<Root>(pkp: PKP<Root>) {
match pkp {
PKP::PartialKeyPath(k) => { /* handle PartialKeyPath */ },
PKP::PartialOptionalKeyPath(k) => { /* handle PartialOptionalKeyPath */ },
PKP::PartialWritableKeyPath(k) => { /* handle PartialWritableKeyPath */ },
PKP::PartialWritableOptionalKeyPath(k) => { /* handle PartialWritableOptionalKeyPath */ },
}
}Variants§
PartialKeyPath(PartialKeyPath<Root>)
Type-erased keypath with known Root but unknown Value.
PartialOptionalKeyPath(PartialOptionalKeyPath<Root>)
Type-erased optional keypath with known Root.
PartialWritableKeyPath(PartialWritableKeyPath<Root>)
Type-erased writable keypath with known Root.
PartialWritableOptionalKeyPath(PartialWritableOptionalKeyPath<Root>)
Type-erased writable optional keypath with known Root.
Trait Implementations§
Source§impl<Root> From<PartialKeyPath<Root>> for PKP<Root>
impl<Root> From<PartialKeyPath<Root>> for PKP<Root>
Source§fn from(kp: RustPartialKeyPath<Root>) -> Self
fn from(kp: RustPartialKeyPath<Root>) -> Self
Converts to this type from the input type.
Source§impl<Root> From<PartialOptionalKeyPath<Root>> for PKP<Root>
impl<Root> From<PartialOptionalKeyPath<Root>> for PKP<Root>
Source§fn from(kp: RustPartialOptionalKeyPath<Root>) -> Self
fn from(kp: RustPartialOptionalKeyPath<Root>) -> Self
Converts to this type from the input type.
Source§impl<Root> From<PartialWritableKeyPath<Root>> for PKP<Root>
impl<Root> From<PartialWritableKeyPath<Root>> for PKP<Root>
Source§fn from(kp: RustPartialWritableKeyPath<Root>) -> Self
fn from(kp: RustPartialWritableKeyPath<Root>) -> Self
Converts to this type from the input type.
Source§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 PKP<Root>
impl<Root> !RefUnwindSafe for PKP<Root>
impl<Root> !Send for PKP<Root>
impl<Root> !Sync for PKP<Root>
impl<Root> Unpin for PKP<Root>where
Root: Unpin,
impl<Root> !UnwindSafe for PKP<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