Trait dd_lib::io::ConvertSlice
source · pub trait ConvertSlice<T> {
fn convert_slice(&self, buf: &mut [T]);
fn convert_clone(&self, buf: &[T]) -> Vec<T>
where
T: Clone + Default,
{ ... }
fn convert_copy(&self, buf: &[T]) -> Vec<T>
where
T: Copy + Default,
{ ... }
}
Expand description
A convertslice can modify a slice of T
in-place, and provides helper
methods to create modified copies.
Required Methods
sourcefn convert_slice(&self, buf: &mut [T])
fn convert_slice(&self, buf: &mut [T])
modify a slice of T
in-place.
Provided Methods
sourcefn convert_clone(&self, buf: &[T]) -> Vec<T>where
T: Clone + Default,
fn convert_clone(&self, buf: &[T]) -> Vec<T>where
T: Clone + Default,
modify a copy of T
created using clone()
. This is less efficient
than convert_copy
.
sourcefn convert_copy(&self, buf: &[T]) -> Vec<T>where
T: Copy + Default,
fn convert_copy(&self, buf: &[T]) -> Vec<T>where
T: Copy + Default,
modify a copy of T
. This is more efficient than
convert_clone
but has tighter
bounds.