[][src]Enum grin_chain::linked_list::ListWrapper

pub enum ListWrapper<T> {
    Single {
        pos: T,
    },
    Multi {
        head: u64,
        tail: u64,
    },
}

Wrapper for the list to handle either Single or Multi entries. Optimized for the common case where we have a single entry in the list.

Variants

Single

List with a single entry. Allows direct access to the pos.

Fields of Single

pos: T

The MMR pos where this single entry is located.

Multi

List with multiple entries. Maintains head and tail of the underlying linked list.

Fields of Multi

head: u64

Head of the linked list.

tail: u64

Tail of the linked list.

Trait Implementations

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

impl<T: Copy> Copy for ListWrapper<T>[src]

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

impl<T: PartialEq> PartialEq<ListWrapper<T>> for ListWrapper<T>[src]

impl<T> Readable for ListWrapper<T> where
    T: Readable
[src]

pub fn read<R: Reader>(reader: &mut R) -> Result<ListWrapper<T>, Error>[src]

Read the first byte to determine what needs to be read beyond that.

impl<T> StructuralPartialEq for ListWrapper<T>[src]

impl<T> Writeable for ListWrapper<T> where
    T: Writeable
[src]

pub fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>[src]

Write first byte representing the variant, followed by variant specific data. "Single" is optimized with embedded "pos". "Multi" has references to "head" and "tail".

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for ListWrapper<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> CloneAny for T where
    T: Clone + Any

impl<T> DebugAny for T where
    T: Any + Debug

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

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

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

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,