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§
Sourcefn spawn(&self, capacity: usize) -> Self
fn spawn(&self, capacity: usize) -> Self
Create a new empty vec with given capacity, using the same allocator.
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§
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.