Struct signalo_filters::source::Take[][src]

pub struct Take<S> { /* fields omitted */ }

A source that returns only up to a specified number of values.

Example:

use signalo_filters::source::Increment;

let increment: Increment<_> = Increment::new(0, 1);
// ╭───╮  ╭───╮  ╭───╮  ╭───╮  ╭───╮
// │ 0 │─▶│ 1 │─▶│ 2 │─▶│ 3 │─▶│ 4 │─▶ ...
// ╰───╯  ╰───╯  ╰───╯  ╰───╯  ╰───╯

use signalo_filters::source::Take;

let take: Take<_> = Take::new(increment, 3);
// ╭───╮  ╭───╮  ╭───╮
// │ 0 │─▶│ 1 │─▶│ 2 │
// ╰───╯  ╰───╯  ╰───╯

Methods

impl<S> Take<S>
[src]

Creates a new Take source for a given value.

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter. Read more

impl<S, T> Source for Take<S> where
    S: 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 Take<S> where
    S: Send

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