pub struct Rate<P> { /* private fields */ }Expand description
See Pattern::rate.
Trait Implementations§
Source§impl<P> Pattern for Rate<P>where
P: Pattern,
impl<P> Pattern for Rate<P>where
P: Pattern,
Source§type Events = EventsRate<<P as Pattern>::Events>
type Events = EventsRate<<P as Pattern>::Events>
An iterator yielding the events occuring within a query’s span.
Source§fn query(&self, span: Span) -> Self::Events
fn query(&self, span: Span) -> Self::Events
Query the pattern for events within the given span. Read more
Source§fn query_cycle(&self) -> Self::Events
fn query_cycle(&self) -> Self::Events
Query the pattern for events within a single cycle, (i.e.
span!(0/1, 1/1)).Source§fn filter<F>(self, predicate: F) -> impl Pattern<Value = Self::Value>
fn filter<F>(self, predicate: F) -> impl Pattern<Value = Self::Value>
Filter the pattern’s events by applying the predicate to their values.
Source§fn filter_events<F>(self, predicate: F) -> impl Pattern<Value = Self::Value>
fn filter_events<F>(self, predicate: F) -> impl Pattern<Value = Self::Value>
Filter the pattern’s events by the given function.
Source§fn map<T, F>(self, map: F) -> MapValues<Self, F>
fn map<T, F>(self, map: F) -> MapValues<Self, F>
Map the values produced by pattern queries with the given function.
Source§fn map_query_points<F>(self, map: F) -> MapQueryPoints<Self, F>
fn map_query_points<F>(self, map: F) -> MapQueryPoints<Self, F>
Map the start and end points of the pattern’s query spans.
Source§fn map_event_points<F>(self, map: F) -> MapEventPoints<Self, F>
fn map_event_points<F>(self, map: F) -> MapEventPoints<Self, F>
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>
fn map_event_lens<F>(self, map: F) -> impl Pattern<Value = Self::Value>
Source§fn map_events<F, T>(self, map: F) -> MapEvents<Self, F>
fn map_events<F, T>(self, map: F) -> MapEvents<Self, F>
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>
fn map_events_iter<E, F, T>(self, map: F) -> MapEventsIter<Self, F>
Map the events iterator produced by the pattern queries with the given function.
Source§fn rate(self, rate: Rational) -> Rate<Self>where
Self: Sized,
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,
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>
fn apply_with<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
Apply the given pattern of functions to
self. Read moreSource§fn apply<P, F, G, B>(self, apply: P, structure: G) -> impl Pattern<Value = B>
fn apply<P, F, G, B>(self, apply: P, structure: G) -> impl Pattern<Value = B>
Apply the given pattern of functions to
self. Read moreSource§fn app<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
fn app<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
Apply the given pattern of functions to
self. Read moreSource§fn appl<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
fn appl<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
Apply the given pattern of functions to
self. Read moreSource§fn appr<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
fn appr<P, F, B>(self, apply: P) -> impl Pattern<Value = B>
Apply the given pattern of functions to
self. Read moreSource§fn merge_with<P, F, T>(self, other: P, merge: F) -> impl Pattern<Value = T>
fn merge_with<P, F, T>(self, other: P, merge: F) -> impl Pattern<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>
fn merge_extend<P>(self, other: P) -> impl Pattern<Value = Self::Value>
Merge the given pattern by calling
Extend<P::Value> for each value at
intersections of active spans. Read moreSource§fn polar(self) -> impl Pattern<Value = Self::Value>
fn polar(self) -> impl Pattern<Value = Self::Value>
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,
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,
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 moreAuto Trait Implementations§
impl<P> Freeze for Rate<P>where
P: Freeze,
impl<P> RefUnwindSafe for Rate<P>where
P: RefUnwindSafe,
impl<P> Send for Rate<P>where
P: Send,
impl<P> Sync for Rate<P>where
P: Sync,
impl<P> Unpin for Rate<P>where
P: Unpin,
impl<P> UnwindSafe for Rate<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more