Struct signalo_filters::source::PadConstant[][src]

pub struct PadConstant<S, T> { /* fields omitted */ }

A source that pads an inner source with a specified number of constant values at the edges.

Example:

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

use signalo_filters::source::Take;
let take = Take::new(increment, 3);
// ╭───╮  ╭───╮  ╭───╮
// │ 0 │─▶│ 1 │─▶│ 2 │
// ╰───╯  ╰───╯  ╰───╯

use signalo_filters::source::PadConstant;
let pad_constant = PadConstant::new(take, 42, 2);
// ╭────╮  ╭────╮  ╭───╮  ╭───╮  ╭───╮  ╭────╮  ╭────╮
// │ 42 │─▶│ 42 │─▶│ 0 │─▶│ 1 │─▶│ 2 │─▶│ 42 │─▶│ 42 │
// ╰────╯  ╰────╯  ╰───╯  ╰───╯  ╰───╯  ╰────╯  ╰────╯

Methods

impl<S, T> Pad<S, T> where
    T: Clone
[src]

Creates a new Pad source from an inner source and specified padding.

Trait Implementations

impl<S: Clone, T: Clone> Clone for Pad<S, T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S: Debug, T: Debug> Debug for Pad<S, T>
[src]

Formats the value using the given formatter. Read more

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

The source's output type.

Produces the next value in the stream of values.

Auto Trait Implementations

impl<S, T> Send for PadConstant<S, T> where
    S: Send,
    T: Send

impl<S, T> Sync for PadConstant<S, T> where
    S: Sync,
    T: Sync