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]

Creates a new Cycle source for a given initial value and an interval.

Trait Implementations

impl<S: Clone> Clone for Cycle<S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for Cycle<S>
[src]

Formats the value using the given formatter. Read more

impl<S, T> Source for Cycle<S> where
    S: Clone + Source<Output = T>, 
[src]

The source's output type.

Produces the next value in the stream of values.

Auto Trait Implementations

impl<S> Send for Cycle<S> where
    S: Send

impl<S> Sync for Cycle<S> where
    S: Sync