pub fn from_iter<I>(frames: I) -> FromIterator<I::IntoIter>
Expand description
Create a new Signal
from the given Frame
-yielding Iterator
.
When the Iterator
is exhausted, the new Signal
will yield F::equilibrium
.
Note that Iterator::next
will be called immediately so that FromIterator
can store the next
pending frame and efficiently test for exhaustiveness.
ยงExample
use dasp_signal::{self as signal, Signal};
fn main() {
let frames = [[1], [-3], [5], [6]];
let mut signal = signal::from_iter(frames.iter().cloned());
assert_eq!(signal.next(), [1]);
assert_eq!(signal.next(), [-3]);
assert_eq!(signal.next(), [5]);
assert_eq!(signal.next(), [6]);
assert_eq!(signal.next(), [0]);
}