Trait basic_dsp_vector::SplitOps [] [src]

pub trait SplitOps {
    fn split_into(&self, targets: &mut [&mut Self]) -> VoidResult;
}

Splits the data into several smaller pieces of equal size.

Required Methods

Splits the vector into several smaller vectors. self.len() must be dividable by targets.len() without a remainder and this condition must be true too targets.len() > 0.

Failures

TransRes may report the following ErrorReason members:

  1. InvalidArgumentLength: self.points() isn't dividable by targets.len()

Example

use basic_dsp_vector::*;
let mut vector =
    vec!(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0).to_real_time_vec();
let mut split = &mut
    [&mut Vec::new().to_real_time_vec(),
     &mut Vec::new().to_real_time_vec()];
vector.split_into(split).expect("Ignoring error handling in examples");
assert_eq!([1.0, 3.0, 5.0, 7.0, 9.0], split[0][..]);

Implementors