pub trait ConvertSlice<T> {
// Required method
fn convert_slice(&self, buf: &mut [T]);
// Provided methods
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>
fn convert_clone(&self, buf: &[T]) -> Vec<T>
modify a copy of T
created using clone()
. This is less efficient
than convert_copy
.
Sourcefn convert_copy(&self, buf: &[T]) -> Vec<T>
fn convert_copy(&self, buf: &[T]) -> Vec<T>
modify a copy of T
. This is more efficient than
convert_clone
but has tighter
bounds.