kaktus

Trait PushPop

Source
pub trait PushPop<T>
where Self: Sized,
{ type This; // Required methods fn push(&self, val: T) -> Self::This; fn pop(&self) -> Option<Self::This>; fn peek(&self) -> Option<&T>; fn walk(&self) -> StackIterator<T> ; // Provided method fn depth(&self) -> usize { ... } }

Required Associated Types§

Required Methods§

Source

fn push(&self, val: T) -> Self::This

Source

fn pop(&self) -> Option<Self::This>

Source

fn peek(&self) -> Option<&T>

Source

fn walk(&self) -> StackIterator<T>

Provided Methods§

Source

fn depth(&self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> PushPop<T> for Option<Stack<T>>

Source§

type This = Stack<T>

Source§

fn push(&self, val: T) -> Self::This

Source§

fn pop(&self) -> Self

Source§

fn peek(&self) -> Option<&T>

Source§

fn walk(&self) -> StackIterator<T>

Implementors§

Source§

impl<T> PushPop<T> for Stack<T>