CollectableVec

Trait CollectableVec 

Source
pub trait CollectableVec<I, T>: IterableVec<I, T>
where Self: Clone, I: VecIndex, T: VecValue,
{ // Provided methods fn iter_range( &self, from: Option<usize>, to: Option<usize>, ) -> impl Iterator<Item = T> { ... } fn iter_signed_range( &self, from: Option<i64>, to: Option<i64>, ) -> impl Iterator<Item = T> { ... } fn collect(&self) -> Vec<T> { ... } fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Vec<T> { ... } fn collect_signed_range(&self, from: Option<i64>, to: Option<i64>) -> Vec<T> { ... } }
Expand description

Trait for vectors that can be collected into standard Rust collections with range support.

Provided Methods§

Source

fn iter_range( &self, from: Option<usize>, to: Option<usize>, ) -> impl Iterator<Item = T>

Returns an iterator over the specified range.

Source

fn iter_signed_range( &self, from: Option<i64>, to: Option<i64>, ) -> impl Iterator<Item = T>

Returns an iterator over the specified range using signed indices (supports negative indexing).

Source

fn collect(&self) -> Vec<T>

Collects all values into a Vec.

Source

fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Vec<T>

Collects values in the specified range into a Vec.

Source

fn collect_signed_range(&self, from: Option<i64>, to: Option<i64>) -> Vec<T>

Collects values in the specified range into a Vec using signed indices.

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<I, T, V> CollectableVec<I, T> for V
where V: IterableVec<I, T> + Clone, I: VecIndex, T: VecValue,