[][src]Trait basic_dsp::ToSlice

pub trait ToSlice<T> {
    fn to_slice(&self) -> &[T];
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn alloc_len(&self) -> usize;
fn try_resize(&mut self, len: usize) -> Result<(), ErrorReason>; }

A trait to convert a type into a slice.

Required methods

Important traits for &'a mut [u8]

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

Convert to a slice.

fn len(&self) -> usize

Length of a slice.

fn is_empty(&self) -> bool

Indicates whether or not this storage type is empty.

fn alloc_len(&self) -> usize

Gets the allocated length of a storage. It's expected that self.alloc_len() >= self.len() in all cases.

fn try_resize(&mut self, len: usize) -> Result<(), ErrorReason>

Resizes the storage to support at least len elements or returns an error if resizing isn't supported.

Loading content...

Implementations on Foreign Types

impl<A> ToSlice<<A as Array>::Item> for ArrayVec<A> where
    A: Array,
    <A as Array>::Item: RealNumber
[src]

impl<T> ToSlice<T> for [T]
[src]

impl<T> ToSlice<T> for Vec<T> where
    T: RealNumber
[src]

impl<'a, T> ToSlice<T> for &'a [T]
[src]

impl<'a, T> ToSlice<T> for &'a mut [T]
[src]

impl<T> ToSlice<T> for Box<[T]>
[src]

Loading content...

Implementors

Loading content...