[][src]Function dasp_slice::boxed::from_boxed_frame_slice

pub fn from_boxed_frame_slice<T, F>(slice: Box<[F]>) -> T where
    F: Frame,
    T: FromBoxedFrameSlice<F>, 

Converts the given boxed slice of Frames into some slice T.

This is a convenience function that wraps the FromBoxedFrameSlice trait.

Examples

fn main() {
    let foo = vec![[0.0, 0.5], [0.0, -0.5]].into_boxed_slice();
    let bar: Box<[f32]> = dasp_slice::from_boxed_frame_slice(foo);
    assert_eq!(bar.into_vec(), vec![0.0, 0.5, 0.0, -0.5]);
}

Required Features

  • When using dasp_slice, this item requires the boxed feature to be enabled.
  • When using dasp, this item requires the slice-boxed feature to be enabled.