Skip to main content

ArrayTrait

Trait ArrayTrait 

Source
pub trait ArrayTrait {
    type Element;

    // Required methods
    fn iter(&self) -> Box<dyn Iterator<Item = &Self::Element> + '_>;
    fn len(&self) -> usize;

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

A trait for the minimal common functionality of a vale array

Required Associated Types§

Source

type Element

Elements of the array

Required Methods§

Source

fn iter(&self) -> Box<dyn Iterator<Item = &Self::Element> + '_>

Iterates over the values paris

Source

fn len(&self) -> usize

Number of key/value pairs

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns if the array is empty

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Array for Vec<T>

Source§

type Element = T

Source§

fn iter(&self) -> Box<dyn Iterator<Item = &T> + '_>

Source§

fn len(&self) -> usize

Implementors§