PKP

Enum PKP 

Source
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>

Source§

fn from(kp: RustPartialKeyPath<Root>) -> Self

Converts to this type from the input type.
Source§

impl<Root> From<PartialOptionalKeyPath<Root>> for PKP<Root>

Source§

fn from(kp: RustPartialOptionalKeyPath<Root>) -> Self

Converts to this type from the input type.
Source§

impl<Root> From<PartialWritableKeyPath<Root>> for PKP<Root>

Source§

fn from(kp: RustPartialWritableKeyPath<Root>) -> Self

Converts to this type from the input type.
Source§

impl<Root> From<PartialWritableOptionalKeyPath<Root>> for PKP<Root>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.