ConcreteVariantArray

Trait ConcreteVariantArray 

Source
pub trait ConcreteVariantArray {
    type Value: VariantValue<VariantArray = Self>;

    // Required methods
    fn is_empty(&self) -> bool;
    fn len(&self) -> usize;
    fn get(&self, index: usize) -> Option<&Self::Value>;
    fn iter(&self) -> impl Iterator<Item = &Self::Value>;
}
Expand description

A trait for the concrete variant array type associated with a variant value.

Required Associated Types§

Source

type Value: VariantValue<VariantArray = Self>

The type of the value in the array.

Required Methods§

Source

fn is_empty(&self) -> bool

Whether the array is empty.

Source

fn len(&self) -> usize

The length of the array.

Source

fn get(&self, index: usize) -> Option<&Self::Value>

Get the value at the given index; None if the index is out of bounds.

Source

fn iter(&self) -> impl Iterator<Item = &Self::Value>

An iterator over the values in the array.

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 ConcreteVariantArray for Vec<Value>

Available on crate feature json only.
Source§

type Value = Value

Source§

fn is_empty(&self) -> bool

Source§

fn len(&self) -> usize

Source§

fn get(&self, index: usize) -> Option<&Self::Value>

Source§

fn iter(&self) -> impl Iterator<Item = &Self::Value>

Source§

impl ConcreteVariantArray for Vec<Value>

Available on crate feature toml only.
Source§

type Value = Value

Source§

fn is_empty(&self) -> bool

Source§

fn len(&self) -> usize

Source§

fn get(&self, index: usize) -> Option<&Self::Value>

Source§

fn iter(&self) -> impl Iterator<Item = &Self::Value>

Implementors§