Struct Signal

Source
pub struct Signal<S>(/* private fields */);
Expand description

See the signal pattern constructor.

Trait Implementations§

Source§

impl<S: Clone> Clone for Signal<S>

Source§

fn clone(&self) -> Signal<S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for Signal<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Ord> Ord for Signal<S>

Source§

fn cmp(&self, other: &Signal<S>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<S: PartialEq> PartialEq for Signal<S>

Source§

fn eq(&self, other: &Signal<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: PartialOrd> PartialOrd for Signal<S>

Source§

fn partial_cmp(&self, other: &Signal<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: Sample> Pattern for Signal<S>

Source§

type Value = <S as Sample>::Value

The type of the values emitted in the pattern’s events.
Source§

type Events = Once<Event<<Signal<S> as Pattern>::Value>>

An iterator yielding the events occuring within a query’s span.
Source§

fn query(&self, active: Span) -> Self::Events

Query the pattern for events within the given span. Read more
Source§

fn query_cycle(&self) -> Self::Events

Query the pattern for events within a single cycle, (i.e. span!(0/1, 1/1)).
Source§

fn into_dyn(self) -> DynPattern<Self::Value>
where Self: 'static + Sized,

Convert the pattern to a trait object behind an Arc and dynamically box queries in order to represent the pattern with a known, sized type. Read more
Source§

fn map<T, F>(self, map: F) -> MapValues<Self, F>
where Self: Sized, F: Fn(Self::Value) -> T,

Map the values produced by pattern queries with the given function.
Source§

fn map_query_points<F>(self, map: F) -> MapQueryPoints<Self, F>
where Self: Sized, F: Fn(Rational) -> Rational,

Map the start and end points of the pattern’s query spans.
Source§

fn map_event_points<F>(self, map: F) -> MapEventPoints<Self, F>
where Self: Sized, F: Fn(Rational) -> Rational,

Map the active and whole span start and end points of events produced by pattern queries with the given function. Useful for mapping time.
Source§

fn map_event_lens<F>(self, map: F) -> impl Pattern<Value = Self::Value>
where Self: Sized, F: Fn(Rational) -> Rational,

Map the length of the active and whole spans of all events produced by self. Read more
Source§

fn map_events<F, T>(self, map: F) -> MapEvents<Self, F>
where Self: Sized, F: Fn(Event<Self::Value>) -> Event<T>,

Map the events produced by pattern queries with the given function.
Source§

fn map_events_iter<E, F, T>(self, map: F) -> MapEventsIter<Self, F>
where Self: Sized, F: Fn(Self::Events) -> E, E: Iterator<Item = Event<T>>,

Map the events iterator produced by the pattern queries with the given function.
Source§

fn rate(self, rate: Rational) -> Rate<Self>
where Self: Sized,

Increase or decrease the rate of event emission by the given value.
Source§

fn shift(self, amount: Rational) -> impl Pattern<Value = Self::Value>
where Self: 'static + Sized,

Shift the pattern by the given amount.
Source§

fn apply_with<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern<Value = F>, F: Fn(ApplyEvent<Self::Value>) -> (B, Option<Span>),

Apply the given pattern of functions to self. Read more
Source§

fn apply<P, F, G, B>(self, apply: P, structure: G) -> impl Pattern<Value = B>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern<Value = F>, F: Fn(Self::Value) -> B, G: 'static + Fn(Span, Span) -> Span,

Apply the given pattern of functions to self. Read more
Source§

fn app<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern<Value = F>, F: Fn(Self::Value) -> B,

Apply the given pattern of functions to self. Read more
Source§

fn appl<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern<Value = F>, F: Fn(Self::Value) -> B,

Apply the given pattern of functions to self. Read more
Source§

fn appr<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern<Value = F>, F: Fn(Self::Value) -> B,

Apply the given pattern of functions to self. Read more
Source§

fn merge_with<P, F, T>(self, other: P, merge: F) -> impl Pattern<Value = T>
where Self: 'static + Sized, Self::Value: Clone, P: 'static + Pattern, P::Value: Clone, F: 'static + Fn(Self::Value, P::Value) -> T,

Merge the given pattern by calling the given function for each value at each active span intersection.
Source§

fn merge_extend<P>(self, other: P) -> impl Pattern<Value = Self::Value>
where Self: 'static + Sized, Self::Value: Clone + Extend<<P::Value as IntoIterator>::Item>, P: 'static + Pattern, P::Value: Clone + IntoIterator,

Merge the given pattern by calling Extend<P::Value> for each value at intersections of active spans. Read more
Source§

fn polar(self) -> impl Pattern<Value = Self::Value>
where Self: Sized, Self::Value: Polar,

Assuming a pattern of values in the range 0 to 1, produces a pattern in the range -1 to 1.
Source§

fn phase(self) -> impl Pattern<Value = [Rational; 2]>
where Self: Sized,

Map a pattern’s active spans to start and end phases through their corresponding whole events.
Source§

fn debug_span(&self, span: Span) -> PatternDebug<'_, Self::Value, Self::Events>
where Self: Sized,

Return a wrapper providing a fmt::Debug implementation for the pattern. Read more
Source§

fn debug(&self) -> PatternDebug<'_, Self::Value, Self::Events>
where Self: Sized,

Return a wrapper providing a fmt::Debug implementation for the pattern. Read more
Source§

impl<S: Eq> Eq for Signal<S>

Source§

impl<S> StructuralPartialEq for Signal<S>

Auto Trait Implementations§

§

impl<S> Freeze for Signal<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Signal<S>
where S: RefUnwindSafe,

§

impl<S> Send for Signal<S>
where S: Send,

§

impl<S> Sync for Signal<S>
where S: Sync,

§

impl<S> Unpin for Signal<S>
where S: Unpin,

§

impl<S> UnwindSafe for Signal<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.