[][src]Struct nstack::NStack

pub struct NStack<T, A, H>(_, _)
where
    T: Content<H>,
    Self: Compound<H>,
    H: ByteHash
;

A stack datastructure with indexed lookup.

Implementations

impl<T, A, H> NStack<T, A, H> where
    T: Content<H>,
    A: Content<H> + Annotation<T, H>,
    H: ByteHash, 
[src]

pub fn new() -> Self[src]

Creates a new empty NStack

pub fn push(&mut self, t: T) -> Result<()>[src]

Pushes a new element onto the stack

pub fn pop(&mut self) -> Result<Option<T>>[src]

Pop an element off the stack.

Returns the popped element, if any.

pub fn get<U>(&self, idx: U) -> Result<Option<Branch<Self, H>>> where
    U: Counter,
    Self::Annotation: Borrow<Cardinality<U>>, 
[src]

Get a branch pointing to the element stored at index idx, if any

pub fn get_mut<U>(&mut self, idx: U) -> Result<Option<BranchMut<Self, H>>> where
    U: Counter,
    Self::Annotation: Borrow<Cardinality<U>>, 
[src]

Get a mutable branch pointing to the element stored at index idx, if any

Trait Implementations

impl<T: Clone, A: Clone, H: Clone> Clone for NStack<T, A, H> where
    T: Content<H>,
    Self: Compound<H>,
    H: ByteHash, 
[src]

impl<T, A, H> Compound<H> for NStack<T, A, H> where
    T: Content<H>,
    A: Content<H> + Annotation<T, H>,
    H: ByteHash, 
[src]

type Leaf = T

The leaf type of the compound structure

type Annotation = A

The node-annotation type

impl<T, A, H> Content<H> for NStack<T, A, H> where
    T: Content<H>,
    A: Content<H> + Annotation<T, H>,
    H: ByteHash, 
[src]

impl<T, A, H> Default for NStack<T, A, H> where
    T: Content<H>,
    A: Content<H> + Annotation<T, H>,
    H: ByteHash, 
[src]

Auto Trait Implementations

impl<T, A, H> !RefUnwindSafe for NStack<T, A, H>

impl<T, A, H> !Send for NStack<T, A, H>

impl<T, A, H> !Sync for NStack<T, A, H>

impl<T, A, H> !Unpin for NStack<T, A, H>

impl<T, A, H> !UnwindSafe for NStack<T, A, H>

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<C, H> CorrectEmptyState<H> for C where
    C: Compound<H>,
    H: ByteHash, 
[src]

impl<T> Erased for T

impl<T> Erased for T

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

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

impl<C, H> LeafIterable<H> for C where
    C: Compound<H>,
    H: ByteHash, 
[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.

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

impl<C, V, H> ValIterable<V, H> for C where
    C: Compound<H>,
    H: ByteHash, 
[src]