pub trait HasLength {
    // Required method
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for data structures which have a length.

Required Methods§

source

fn len(&self) -> usize

Return the length of the data structure.

Provided Methods§

source

fn is_empty(&self) -> bool

Return whether the data structure is empty.

Implementations on Foreign Types§

source§

impl<A> HasLength for VecDeque<A>

source§

fn len(&self) -> usize

Implementors§

source§

impl<'a, A: 'a, const N: usize> HasLength for Slice<'a, A, N>

source§

impl<'a, A: 'a, const N: usize> HasLength for SliceMut<'a, A, N>

source§

impl<A, const N: usize> HasLength for RingBuffer<A, N>