[][src]Enum pour::mutation::Mutation

pub enum Mutation<K, V> {
    Null,
    Remove,
    Insert(K, V),
    Update(V),
}

A mutation to perform at a single key-value pair

Variants

Null

Leave the entry alone

Remove

Remove the entry

Insert(K, V)

Replace only a nonexisting entry with another value

Update(V)

Replace only an existing entry with another value

Implementations

impl<K, V> Mutation<K, V>[src]

pub fn normalize(self, is_empty: bool) -> Mutation<K, V>[src]

Transform an action into the appropriate action for a potentially empty entry

A user usually does not need to worry about this, as it is done automatically with the result of the mutate function

pub fn is_null(&self) -> bool[src]

Check whether an action is null

Trait Implementations

impl<K: Clone, V: Clone> Clone for Mutation<K, V>[src]

impl<K: Copy, V: Copy> Copy for Mutation<K, V>[src]

impl<K: Debug, V: Debug> Debug for Mutation<K, V>[src]

impl<K: Eq, V: Eq> Eq for Mutation<K, V>[src]

impl<K: Hash, V: Hash> Hash for Mutation<K, V>[src]

impl<K: PartialEq, V: PartialEq> PartialEq<Mutation<K, V>> for Mutation<K, V>[src]

impl<K, V> StructuralEq for Mutation<K, V>[src]

impl<K, V> StructuralPartialEq for Mutation<K, V>[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Mutation<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for Mutation<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Mutation<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Mutation<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Mutation<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.