ReadableVecExt

Trait ReadableVecExt 

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

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

Provided Methods§

Source

fn len(&self) -> usize
where T: 'static,

Returns the length of the inner vector.

Source

fn is_empty(&self) -> bool
where T: 'static,

Returns true if the inner vector is empty.

Source

fn first(&self) -> Option<ReadableRef<'_, Self, T>>
where T: 'static,

Get the first element of the inner vector.

Source

fn last(&self) -> Option<ReadableRef<'_, Self, T>>
where T: 'static,

Get the last element of the inner vector.

Source

fn get(&self, index: usize) -> Option<ReadableRef<'_, Self, T>>
where T: 'static,

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.

Implementors§

Source§

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