Trait ReadableVecExt

Source
pub trait ReadableVecExt<T>: Readable<Target = Vec<T>>
where T: 'static,
{ // Provided methods fn len(&self) -> usize { ... } fn is_empty(&self) -> bool { ... } fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>> { ... } fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>> { ... } fn get( &self, index: usize, ) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>> { ... } fn iter(&self) -> ReadableValueIterator<'_, Self> where Self: Sized { ... } }
Expand description

An extension trait for Readable<Vec> that provides some convenience methods.

Provided Methods§

Source

fn len(&self) -> usize

Returns the length of the inner vector.

Source

fn is_empty(&self) -> bool

Returns true if the inner vector is empty.

Source

fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>

Get the first element of the inner vector.

Source

fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>

Get the last element of the inner vector.

Source

fn get(&self, index: usize) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>

Get the element at the given index of the inner vector.

Source

fn iter(&self) -> ReadableValueIterator<'_, Self>
where Self: Sized,

Get an iterator over the values of the inner vector.

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.

Implementors§

Source§

impl<T, R> ReadableVecExt<T> for R
where T: 'static, R: Readable<Target = Vec<T>>,