Struct signalo_sources::cycle::Cycle [−][src]
pub struct Cycle<S> { /* fields omitted */ }
A source that repeats an auto-incremented value on each call.
Example:
use signalo_sources::from_iter::FromIter; let iter = FromIter::from(vec![0, 1, 2]); // ╭───╮ ╭───╮ ╭───╮ // │ 0 │─▶│ 1 │─▶│ 2 │ // ╰───╯ ╰───╯ ╰───╯ use signalo_sources::cycle::Cycle; let cycle = Cycle::new(iter); // ╭───╮ ╭───╮ ╭───╮ ╭───╮ ╭───╮ ╭───╮ // │ 0 │─▶│ 1 │─▶│ 2 │─▶│ 0 │─▶│ 1 │─▶│ 2 │─▶ ... // ╰───╯ ╰───╯ ╰───╯ ╰───╯ ╰───╯ ╰───╯
Methods
impl<S> Cycle<S> where
S: Clone,
[src]
impl<S> Cycle<S> where
S: Clone,
pub fn new(orig: S) -> Self
[src]
pub fn new(orig: S) -> Self
Creates a new Cycle
source for a given initial
value and an interval
.
Trait Implementations
impl<S: Clone> Clone for Cycle<S>
[src]
impl<S: Clone> Clone for Cycle<S>
fn clone(&self) -> Cycle<S>
[src]
fn clone(&self) -> Cycle<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for Cycle<S>
[src]
impl<S: Debug> Debug for Cycle<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S, T> Source for Cycle<S> where
S: Clone + Source<Output = T>,
[src]
impl<S, T> Source for Cycle<S> where
S: Clone + Source<Output = T>,