[][src]Enum mogwai::view::interface::Patch

pub enum Patch<T> {
    Insert {
        index: usize,
        value: T,
    },
    Replace {
        index: usize,
        value: T,
    },
    Remove {
        index: usize,
    },
    RemoveAll,
    PushFront {
        value: T,
    },
    PushBack {
        value: T,
    },
    PopFront,
    PopBack,
    Keep {
        first: usize,
    },
    Drop {
        first: usize,
    },
}

Variants used to patch the children of a View.

Variants

Insert

Insert a child node at a certain index. Zero-indexed.

Fields of Insert

index: usize

The index to insert the child node.

value: T

The child node.

Replace

Replace a child at a certain index. Zero-indexed.

Fields of Replace

index: usize

The index of the child to replace.

value: T

The replacement child.

Remove

Remove the child at a certain index. Zero-indexed.

Fields of Remove

index: usize

The index of the child to remove.

RemoveAll

Remove all child nodes.

PushFront

Push a child node onto the front of the list of child nodes.

Fields of PushFront

value: T

The child to push at the front.

PushBack

Push a child node onto the back of the list of child nodes.

Fields of PushBack

value: T

The child to push on the back.

PopFront

Remove the first child node.

PopBack

Remove the last child node.

Keep

Keep the first N nodes.

Fields of Keep

first: usize

The number/size of the first nodes to keep.

Drop

Drop the first N nodes.

Fields of Drop

first: usize

the number/size of the first nodes to drop.

Trait Implementations

impl<T: Clone> Clone for Patch<T>[src]

impl<T: Debug> Debug for Patch<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Patch<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Patch<T> where
    T: Send
[src]

impl<T> Sync for Patch<T> where
    T: Sync
[src]

impl<T> Unpin for Patch<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Patch<T> where
    T: UnwindSafe
[src]

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