[−][src]Trait langis::Signal
The main signal trait. Every signal must implement this trait.
Associated Types
type Type
The type of the signal.
Required methods
Loading content...Provided methods
fn add<S>(self, other: S) -> Add<Self, S> where
Self: Sized,
S: Signal,
Self::Type: Add<S::Type>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
Self: Sized,
S: Signal,
Self::Type: Shl<S::Type>,
Performs the <<
operation.
fn neg(self) -> Neg<Self> where
Self: Sized,
Self::Type: Neg,
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,
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,
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,
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,
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,
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>,
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,
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),
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,
Self: Sized,
S: Signal,
Zips this signal with another.
fn into<T>(self) -> Into<Self, T> where
Self: Sized,
Self::Type: Into<T>,
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,
Self: Sized,
Skips n
values of the signal.
fn into_iter(self) -> IntoIter<Self>ⓘ where
Self: Sized,
Self: Sized,
Creates an iterator that yields the values of this signal.
Implementors
impl<'a, S, T> Signal for Cloned<S> where
T: 'a + Clone,
S: Signal<Type = &'a T>,
[src]
T: 'a + Clone,
S: Signal<Type = &'a T>,
impl<A, B> Signal for Max<A, B> where
A: Signal,
B: Signal<Type = A::Type>,
A::Type: Ord,
[src]
A: Signal,
B: Signal<Type = A::Type>,
A::Type: Ord,
impl<A, B> Signal for Min<A, B> where
A: Signal,
B: Signal<Type = A::Type>,
A::Type: Ord,
[src]
A: Signal,
B: Signal<Type = A::Type>,
A::Type: Ord,
impl<A, B> Signal for Zip<A, B> where
A: Signal,
B: Signal,
[src]
A: Signal,
B: Signal,
impl<F, T> Signal for Gen<F> where
F: FnMut() -> T,
[src]
F: FnMut() -> T,
impl<I> Signal for Cycle<I> where
I: Iterator + Clone,
[src]
I: Iterator + Clone,
impl<L, R> Signal for Add<L, R> where
L: Signal,
R: Signal,
L::Type: Add<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Add<R::Type>,
impl<L, R> Signal for BitAnd<L, R> where
L: Signal,
R: Signal,
L::Type: BitAnd<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: BitAnd<R::Type>,
impl<L, R> Signal for BitOr<L, R> where
L: Signal,
R: Signal,
L::Type: BitOr<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: BitOr<R::Type>,
impl<L, R> Signal for BitXor<L, R> where
L: Signal,
R: Signal,
L::Type: BitXor<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: BitXor<R::Type>,
impl<L, R> Signal for Div<L, R> where
L: Signal,
R: Signal,
L::Type: Div<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Div<R::Type>,
impl<L, R> Signal for Mul<L, R> where
L: Signal,
R: Signal,
L::Type: Mul<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Mul<R::Type>,
impl<L, R> Signal for Rem<L, R> where
L: Signal,
R: Signal,
L::Type: Rem<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Rem<R::Type>,
impl<L, R> Signal for Shl<L, R> where
L: Signal,
R: Signal,
L::Type: Shl<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Shl<R::Type>,
impl<L, R> Signal for Shr<L, R> where
L: Signal,
R: Signal,
L::Type: Shr<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Shr<R::Type>,
impl<L, R> Signal for Sub<L, R> where
L: Signal,
R: Signal,
L::Type: Sub<R::Type>,
[src]
L: Signal,
R: Signal,
L::Type: Sub<R::Type>,
impl<S> Signal for Neg<S> where
S: Signal,
S::Type: Neg,
[src]
S: Signal,
S::Type: Neg,
impl<S> Signal for Skip<S> where
S: Signal,
[src]
S: Signal,
impl<S, F> Signal for Filter<S, F> where
S: Signal,
F: FnMut(&S::Type) -> bool,
[src]
S: Signal,
F: FnMut(&S::Type) -> bool,
impl<S, F> Signal for Inspect<S, F> where
S: Signal,
F: FnMut(&S::Type),
[src]
S: Signal,
F: FnMut(&S::Type),
impl<S, F, T> Signal for FilterMap<S, F> where
S: Signal,
F: FnMut(S::Type) -> Option<T>,
[src]
S: Signal,
F: FnMut(S::Type) -> Option<T>,
impl<S, F, T> Signal for Map<S, F> where
S: Signal,
F: FnMut(S::Type) -> T,
[src]
S: Signal,
F: FnMut(S::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]
S: Signal,
Min: Signal<Type = S::Type>,
Max: Signal<Type = S::Type>,
S::Type: Ord,
impl<S, T> Signal for Into<S, T> where
S: Signal,
S::Type: Into<T>,
[src]
S: Signal,
S::Type: Into<T>,
impl<T, F> Signal for Successors<T, F> where
F: FnMut(&T) -> T,
[src]
F: FnMut(&T) -> T,