Expand description
A signal is a structure that can yield an infinite amount of data. The API is very similar to std::iter::Iterator
but with the assumption that it will never end.
§Example
use langis::Signal;
let mut my_signal = langis::cycle( "hello".chars() );
for _ in 0..100 {
assert_eq!(my_signal.next(), 'h');
assert_eq!(my_signal.next(), 'e');
assert_eq!(my_signal.next(), 'l');
assert_eq!(my_signal.next(), 'l');
assert_eq!(my_signal.next(), 'o');
}
Modules§
- comp
- This module contains signals that are created using functions in the main signal trait.
- gen
- This module contains signal generators.
- noise
- Signals that deal with randomness.
- num
- Signals that depend on the
num-traits
crate.
Traits§
- Signal
- The main signal trait. Every signal must implement this trait.
Functions§
- constant
- Creates a signal that yields a constant given value.
- cycle
- Creates a signal that endlessly repeats the items of an iterator.
- default
- Creates a signal that yields the default value of
T
. - gen
- Creates a signal that yields the return values of a given function.
- oscillator
- Creates a new oscillator.
- random
- Creates a new random signal that uses
rand::thread_rng()
as a random number generator andStandard
as distribution. - random_
complete - Creates a new random signal.
- sawtooth
- Creates a sawtooth wave.
- simplex
- Creates a new signal that yield simplex noise.
- sine
- Creates a sine wave.
- square
- Creates a square wave.
- successors
- Creates a signal where each successive value is computed based on the preceding one.
- triangle
- Creates a triangle wave.