Skip to main content

VirtualVector

Trait VirtualVector 

Source
pub trait VirtualVector<T> {
    // Required methods
    fn total_len(&self) -> usize;
    fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn enumerate(self) -> Enumerate<Self, T>
       where Self: Sized { ... }
}
Expand description

A trait that can be implemented on a type so that the type can be used in a virtual_stack or virtual_list.

Required Methods§

Source

fn total_len(&self) -> usize

Source

fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn enumerate(self) -> Enumerate<Self, T>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> VirtualVector<T> for GenericVector<T, ArcK>
where T: Clone,

Source§

fn total_len(&self) -> usize

Source§

fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>

Source§

impl<T> VirtualVector<T> for Range<T>
where T: Add<Output = T> + Copy + PartialOrd + From<usize> + Sub<Output = T>, usize: From<T>, Range<T>: Iterator<Item = T>,

Source§

fn total_len(&self) -> usize

Source§

fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>

Source§

impl<T> VirtualVector<T> for RangeInclusive<T>
where T: Add<Output = T> + Copy + PartialOrd + From<usize> + Sub<Output = T>, usize: From<T>, Range<T>: Iterator<Item = T>,

Source§

fn total_len(&self) -> usize

Source§

fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>

Source§

impl<T> VirtualVector<T> for ReadSignal<Vec<T>>
where T: Clone + 'static,

Source§

fn total_len(&self) -> usize

Source§

fn slice(&self, range: Range<usize>) -> impl Iterator<Item = T>

Implementors§

Source§

impl<T> VirtualVector<T> for RwSignal<Vec<T>>
where T: Clone + 'static,

Source§

impl<V, T> VirtualVector<(usize, T)> for Enumerate<V, T>
where V: VirtualVector<T>,