[][src]Trait langis::Signal

pub trait Signal {
    type Type;
    fn next(&mut self) -> Self::Type;

    fn add<S>(self, other: S) -> Add<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Add<S::Type>
, { ... }
fn sub<S>(self, other: S) -> Sub<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Sub<S::Type>
, { ... }
fn mul<S>(self, other: S) -> Mul<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Mul<S::Type>
, { ... }
fn div<S>(self, other: S) -> Div<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Div<S::Type>
, { ... }
fn rem<S>(self, other: S) -> Rem<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Rem<S::Type>
, { ... }
fn bitand<S>(self, other: S) -> BitAnd<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: BitAnd<S::Type>
, { ... }
fn bitor<S>(self, other: S) -> BitOr<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: BitOr<S::Type>
, { ... }
fn bitxor<S>(self, other: S) -> BitXor<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: BitXor<S::Type>
, { ... }
fn shr<S>(self, other: S) -> Shr<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Shr<S::Type>
, { ... }
fn shl<S>(self, other: S) -> Shl<Self, S>
    where
        Self: Sized,
        S: Signal,
        Self::Type: Shl<S::Type>
, { ... }
fn neg(self) -> Neg<Self>
    where
        Self: Sized,
        Self::Type: Neg
, { ... }
fn min<S>(self, other: S) -> Min<Self, S>
    where
        Self: Sized,
        S: Signal<Type = Self::Type>,
        Self::Type: Ord
, { ... }
fn max<S>(self, other: S) -> Max<Self, S>
    where
        Self: Sized,
        S: Signal<Type = Self::Type>,
        Self::Type: Ord
, { ... }
fn clamp<Min, Max>(self, min: Min, max: Max) -> Clamp<Self, Min, Max>
    where
        Self: Sized,
        Min: Signal<Type = Self::Type>,
        Max: Signal<Type = Self::Type>,
        Self::Type: Ord
, { ... }
fn map<F, T>(self, map: F) -> Map<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Type) -> T
, { ... }
fn filter<F>(self, predicate: F) -> Filter<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Type) -> bool
, { ... }
fn filter_map<F, T>(self, predicate: F) -> FilterMap<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Type) -> Option<T>
, { ... }
fn cloned<'a, T>(self) -> Cloned<Self>
    where
        Self: Sized + Signal<Type = &'a T>,
        T: 'a + Clone
, { ... }
fn inspect<F>(self, inspect: F) -> Inspect<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Type)
, { ... }
fn zip<S>(self, other: S) -> Zip<Self, S>
    where
        Self: Sized,
        S: Signal
, { ... }
fn into<T>(self) -> Into<Self, T>
    where
        Self: Sized,
        Self::Type: Into<T>
, { ... }
fn skip(self, n: usize) -> Skip<Self>
    where
        Self: Sized
, { ... }
fn into_iter(self) -> IntoIter<Self>

Notable traits for IntoIter<S>

impl<S> Iterator for IntoIter<S> where
    S: Signal
type Item = S::Type;

    where
        Self: Sized
, { ... } }

The main signal trait. Every signal must implement this trait.

Associated Types

type Type

The type of the signal.

Loading content...

Required methods

fn next(&mut self) -> Self::Type

Returns the next value of this signal.

Loading content...

Provided methods

fn add<S>(self, other: S) -> Add<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Add<S::Type>, 

Performs the + operation.

fn sub<S>(self, other: S) -> Sub<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Sub<S::Type>, 

Performs the - operation.

fn mul<S>(self, other: S) -> Mul<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Mul<S::Type>, 

Performs the * operation.

fn div<S>(self, other: S) -> Div<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Div<S::Type>, 

Performs the / operation.

fn rem<S>(self, other: S) -> Rem<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Rem<S::Type>, 

Performs the % operation.

fn bitand<S>(self, other: S) -> BitAnd<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: BitAnd<S::Type>, 

Performs the & operation.

fn bitor<S>(self, other: S) -> BitOr<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: BitOr<S::Type>, 

Performs the | operation.

fn bitxor<S>(self, other: S) -> BitXor<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: BitXor<S::Type>, 

Performs the ^ operation.

fn shr<S>(self, other: S) -> Shr<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Shr<S::Type>, 

Performs the >> operation.

fn shl<S>(self, other: S) -> Shl<Self, S> where
    Self: Sized,
    S: Signal,
    Self::Type: Shl<S::Type>, 

Performs the << operation.

fn neg(self) -> Neg<Self> where
    Self: Sized,
    Self::Type: Neg

Negates this signal.

fn min<S>(self, other: S) -> Min<Self, S> where
    Self: Sized,
    S: Signal<Type = Self::Type>,
    Self::Type: Ord

Returns the minimum of this signal and the other.

fn max<S>(self, other: S) -> Max<Self, S> where
    Self: Sized,
    S: Signal<Type = Self::Type>,
    Self::Type: Ord

Returns the maximum of this signal and the other.

fn clamp<Min, Max>(self, min: Min, max: Max) -> Clamp<Self, Min, Max> where
    Self: Sized,
    Min: Signal<Type = Self::Type>,
    Max: Signal<Type = Self::Type>,
    Self::Type: Ord

Clamps this signal between min and max. This result of this function is the same as .max(min).min(max).

fn map<F, T>(self, map: F) -> Map<Self, F> where
    Self: Sized,
    F: FnMut(Self::Type) -> T, 

Maps this signal to another using the given function.

fn filter<F>(self, predicate: F) -> Filter<Self, F> where
    Self: Sized,
    F: FnMut(&Self::Type) -> bool, 

Filters values of the signal with the given predicate.

fn filter_map<F, T>(self, predicate: F) -> FilterMap<Self, F> where
    Self: Sized,
    F: FnMut(Self::Type) -> Option<T>, 

Filters and maps a signal to another using the given predicate.

fn cloned<'a, T>(self) -> Cloned<Self> where
    Self: Sized + Signal<Type = &'a T>,
    T: 'a + Clone

Clones the values of this signal. This is useful to turn a Signal<Type = &T> into a Signal<Type = T>.

fn inspect<F>(self, inspect: F) -> Inspect<Self, F> where
    Self: Sized,
    F: FnMut(&Self::Type), 

Inspects the values of this signal by calling a function before yielding the value.

fn zip<S>(self, other: S) -> Zip<Self, S> where
    Self: Sized,
    S: Signal

Zips this signal with another.

fn into<T>(self) -> Into<Self, T> where
    Self: Sized,
    Self::Type: Into<T>, 

Turns this signal into another using the Into trait.

fn skip(self, n: usize) -> Skip<Self> where
    Self: Sized

Skips n values of the signal.

fn into_iter(self) -> IntoIter<Self>

Notable traits for IntoIter<S>

impl<S> Iterator for IntoIter<S> where
    S: Signal
type Item = S::Type;
where
    Self: Sized

Creates an iterator that yields the values of this signal.

Loading content...

Implementors

impl<'a, S, T> Signal for Cloned<S> where
    T: 'a + Clone,
    S: Signal<Type = &'a T>, 
[src]

type Type = T

impl<A, B> Signal for Max<A, B> where
    A: Signal,
    B: Signal<Type = A::Type>,
    A::Type: Ord
[src]

type Type = A::Type

impl<A, B> Signal for Min<A, B> where
    A: Signal,
    B: Signal<Type = A::Type>,
    A::Type: Ord
[src]

type Type = A::Type

impl<A, B> Signal for Zip<A, B> where
    A: Signal,
    B: Signal
[src]

type Type = (A::Type, B::Type)

impl<F, T> Signal for Gen<F> where
    F: FnMut() -> T, 
[src]

type Type = T

impl<I> Signal for Cycle<I> where
    I: Iterator + Clone
[src]

type Type = I::Item

impl<L, R> Signal for Add<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Add<R::Type>, 
[src]

type Type = <L::Type as Add<R::Type>>::Output

impl<L, R> Signal for BitAnd<L, R> where
    L: Signal,
    R: Signal,
    L::Type: BitAnd<R::Type>, 
[src]

type Type = <L::Type as BitAnd<R::Type>>::Output

impl<L, R> Signal for BitOr<L, R> where
    L: Signal,
    R: Signal,
    L::Type: BitOr<R::Type>, 
[src]

type Type = <L::Type as BitOr<R::Type>>::Output

impl<L, R> Signal for BitXor<L, R> where
    L: Signal,
    R: Signal,
    L::Type: BitXor<R::Type>, 
[src]

type Type = <L::Type as BitXor<R::Type>>::Output

impl<L, R> Signal for Div<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Div<R::Type>, 
[src]

type Type = <L::Type as Div<R::Type>>::Output

impl<L, R> Signal for Mul<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Mul<R::Type>, 
[src]

type Type = <L::Type as Mul<R::Type>>::Output

impl<L, R> Signal for Rem<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Rem<R::Type>, 
[src]

type Type = <L::Type as Rem<R::Type>>::Output

impl<L, R> Signal for Shl<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Shl<R::Type>, 
[src]

type Type = <L::Type as Shl<R::Type>>::Output

impl<L, R> Signal for Shr<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Shr<R::Type>, 
[src]

type Type = <L::Type as Shr<R::Type>>::Output

impl<L, R> Signal for Sub<L, R> where
    L: Signal,
    R: Signal,
    L::Type: Sub<R::Type>, 
[src]

type Type = <L::Type as Sub<R::Type>>::Output

impl<S> Signal for Neg<S> where
    S: Signal,
    S::Type: Neg
[src]

type Type = <S::Type as Neg>::Output

impl<S> Signal for Skip<S> where
    S: Signal
[src]

type Type = S::Type

impl<S, F> Signal for Filter<S, F> where
    S: Signal,
    F: FnMut(&S::Type) -> bool, 
[src]

type Type = S::Type

impl<S, F> Signal for Inspect<S, F> where
    S: Signal,
    F: FnMut(&S::Type), 
[src]

type Type = S::Type

impl<S, F, T> Signal for FilterMap<S, F> where
    S: Signal,
    F: FnMut(S::Type) -> Option<T>, 
[src]

type Type = T

impl<S, F, T> Signal for Map<S, F> where
    S: Signal,
    F: FnMut(S::Type) -> T, 
[src]

type Type = T

impl<S, Min, Max> Signal for Clamp<S, Min, Max> where
    S: Signal,
    Min: Signal<Type = S::Type>,
    Max: Signal<Type = S::Type>,
    S::Type: Ord
[src]

type Type = S::Type

impl<S, T> Signal for Into<S, T> where
    S: Signal,
    S::Type: Into<T>, 
[src]

type Type = T

impl<T, F> Signal for Successors<T, F> where
    F: FnMut(&T) -> T, 
[src]

type Type = T

impl<T: Clone> Signal for Const<T>[src]

type Type = T

Loading content...