logo
pub struct Stack<T> where
    T: Default + Clone
{ /* private fields */ }
Expand description

A stack implementation of the Stackable trait, based on a vector.

Implementations

Creates a new empty stack.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The kind of item the stack holds.

Checks whether the stack is empty.

Extracts a slice containing the entire stack.

Appends one item to the end of the stack.

Removes the last item of the stack and returns it, None if the stack is empty. Read more

Removes n elements from the end of the stack, None if the stack doesn’t contain enough elements. Returned items are in reverse order: the last element comes last in the list. Read more

Peek the last item of the stack and returns a reference to it, None if the stack is empty. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.