Trait music_theory::theory::traits::VecWrapper

source ·
pub trait VecWrapper {
    type Item;

    // Required methods
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn iter(&self) -> Iter<'_, Self::Item>;
    fn contains(&self, item: &Self::Item) -> bool;
    fn contains_all(&self, items: &[Self::Item]) -> bool;
    fn contains_any(&self, items: &[Self::Item]) -> bool;
}
Expand description

Wrapper around existing vector types. Used for the new type pattern.

Required Associated Types§

source

type Item

The type the new type wraps.

Required Methods§

source

fn len(&self) -> usize

Return the length of the inner vector.

source

fn is_empty(&self) -> bool

Return whether the inner vector is empty or not.

source

fn iter(&self) -> Iter<'_, Self::Item>

Iterate over the inner vector.

source

fn contains(&self, item: &Self::Item) -> bool

Returns whether the inner vector contains an item.

source

fn contains_all(&self, items: &[Self::Item]) -> bool

Returns whether the inner vector contains all of the given items.

source

fn contains_any(&self, items: &[Self::Item]) -> bool

Returns whether the inner vector contains any of the given items.

Implementors§