Struct signalo_filters::source::Constant[][src]

pub struct Constant<T> { /* fields omitted */ }

A source that returns an constant value on each call.

Example:

use signalo_filters::source::Constant;
let constant = Constant::new(42);
// ╭────╮  ╭────╮  ╭────╮  ╭────╮  ╭────╮
// │ 42 │─▶│ 42 │─▶│ 42 │─▶│ 42 │─▶│ 42 │─▶ ...
// ╰────╯  ╰────╯  ╰────╯  ╰────╯  ╰────╯

Methods

impl<T> Constant<T>
[src]

Creates a new Constant source for a given value.

Trait Implementations

impl<T: Default> Default for Constant<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Clone> Clone for Constant<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Constant<T>
[src]

Formats the value using the given formatter. Read more

impl<T> From<T> for Constant<T>
[src]

Performs the conversion.

impl<T> Source for Constant<T> where
    T: Clone
[src]

The source's output type.

Produces the next value in the stream of values.

Auto Trait Implementations

impl<T> Send for Constant<T> where
    T: Send

impl<T> Sync for Constant<T> where
    T: Sync