Skip to main content

DataVec

Trait DataVec 

Source
pub trait DataVec<T: Clone>: Deref<Target = [T]> + Clone {
    // Required methods
    fn spawn(&self, capacity: usize) -> Self;
    fn push(&mut self, value: T);
    fn clear(&mut self);
    fn len(&self) -> usize;
    fn as_slice(&self) -> &[T];
    fn get(&self, idx: usize) -> Option<&T>;
    fn extend_from_slice(&mut self, other: &[T]);
    fn extend_iter(&mut self, iter: impl Iterator<Item = T>);
    fn capacity(&self) -> usize;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn take(&self, n: usize) -> Self { ... }
}
Expand description

Trait for vector-like storage of column values.

Required Methods§

Source

fn spawn(&self, capacity: usize) -> Self

Create a new empty vec with given capacity, using the same allocator.

Source

fn push(&mut self, value: T)

Source

fn clear(&mut self)

Source

fn len(&self) -> usize

Source

fn as_slice(&self) -> &[T]

Source

fn get(&self, idx: usize) -> Option<&T>

Source

fn extend_from_slice(&mut self, other: &[T])

Source

fn extend_iter(&mut self, iter: impl Iterator<Item = T>)

Source

fn capacity(&self) -> usize

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn take(&self, n: usize) -> Self

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: Clone + PartialEq> DataVec<T> for CowVec<T>