pub struct PingPong<Source> { /* private fields */ }Expand description
A finite forward/backward cycle produced by Animation::ping_pong.
Trait Implementations§
Source§impl<Value, Source: Animation<Value>> Animation<Value> for PingPong<Source>
impl<Value, Source: Animation<Value>> Animation<Value> for PingPong<Source>
Source§fn sample(&self, time: Time) -> Value
fn sample(&self, time: Time) -> Value
Samples without advancing a clock or changing playback state.
Source§fn duration(&self) -> Option<Duration>
fn duration(&self) -> Option<Duration>
Returns the finite duration, or
None for an unbounded signal.Source§fn map<Output, Function>(self, function: Function) -> Map<Self, Function, Value>
fn map<Output, Function>(self, function: Function) -> Map<Self, Function, Value>
Transforms values without changing timing.
Source§fn zip<OtherValue, Other>(self, other: Other) -> Zip<Self, Other>
fn zip<OtherValue, Other>(self, other: Other) -> Zip<Self, Other>
Samples in parallel; the duration is infinite if either input is infinite.
Source§fn delay(self, offset: Duration) -> Delay<Self>where
Self: Sized,
fn delay(self, offset: Duration) -> Delay<Self>where
Self: Sized,
Delays a finite animation, holding its initial value before the offset.
Infinite signals shift their signed time instead. Negative offsets and
finite duration overflow panic at construction.
Source§fn speed(self, factor: f64) -> Speed<Self>where
Self: Sized,
fn speed(self, factor: f64) -> Speed<Self>where
Self: Sized,
Changes playback speed by a finite, strictly positive factor.
Durations round to the nearest tick; a collapsed finite animation becomes
instantaneous. Invalid factors and unrepresentable durations panic.
Source§fn then<Next: Animation<Value>>(self, next: Next) -> Then<Self, Next>where
Self: Sized,
fn then<Next: Animation<Value>>(self, next: Next) -> Then<Self, Next>where
Self: Sized,
Runs two finite animations in sequence. The second owns their shared
boundary. Infinite sources or duration overflow panic at construction.
Source§fn reverse(self) -> Reverse<Self>where
Self: Sized,
fn reverse(self) -> Reverse<Self>where
Self: Sized,
Reverses a finite animation. Infinite sources panic at construction.
Source§fn repeat(self, count: u32) -> Repeat<Self>where
Self: Sized,
fn repeat(self, count: u32) -> Repeat<Self>where
Self: Sized,
Plays a finite animation
count times. Intermediate boundaries restart;
the final boundary holds the target. Zero repeats hold the initial value.
Infinite sources or duration overflow panic at construction.Auto Trait Implementations§
impl<Source> Forget for PingPong<Source>
impl<Source> Freeze for PingPong<Source>where
Source: Freeze,
impl<Source> RefUnwindSafe for PingPong<Source>where
Source: RefUnwindSafe,
impl<Source> Send for PingPong<Source>where
Source: Send,
impl<Source> Sync for PingPong<Source>where
Source: Sync,
impl<Source> Unpin for PingPong<Source>where
Source: Unpin,
impl<Source> UnsafeUnpin for PingPong<Source>where
Source: UnsafeUnpin,
impl<Source> UnwindSafe for PingPong<Source>where
Source: 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