pub enum Playback {
Paused,
Playing {
speed: PlaybackSpeed,
},
}Expand description
The replay playback state (docs/04-replay-mode.md §4): paused, or playing at
a PlaybackSpeed. Playback stops at end_step and never wraps — that
clamp lives in TimelineCursor::seek, so this type models the quantum and
the play/pause transition only, not the tick timer (the tick cadence is the
app’s, issue #34).
Variants§
Paused
Playback is paused (the default on load).
Playing
Playback is running at the given speed.
Fields
speed: PlaybackSpeedThe active speed multiplier.
Implementations§
Source§impl Playback
impl Playback
Sourcepub const fn playing(speed: PlaybackSpeed) -> Self
pub const fn playing(speed: PlaybackSpeed) -> Self
Start playback at speed.
Sourcepub const fn is_playing(self) -> bool
pub const fn is_playing(self) -> bool
Whether playback is currently running.
Sourcepub const fn speed(self) -> Option<PlaybackSpeed>
pub const fn speed(self) -> Option<PlaybackSpeed>
The active PlaybackSpeed, or None while paused.
Sourcepub const fn toggled(self, resume_speed: PlaybackSpeed) -> Self
pub const fn toggled(self, resume_speed: PlaybackSpeed) -> Self
Toggle between paused and playing: pause when playing, or resume at
resume_speed when paused. The pure state transition a play/pause key
drives (issue #34 wires the key).
Sourcepub const fn tick_seek(self) -> Option<SeekTo>
pub const fn tick_seek(self) -> Option<SeekTo>
The SeekTo one scheduled playback tick applies to the cursor, or None
while paused. Playing at ×N yields SeekTo::StepBy(N); the cursor
clamps the result to end_step, so playback stops at the end of the tape
and never wraps (docs/04-replay-mode.md §4). This is the quantum only —
the tick cadence is the app’s (issue #34).
Trait Implementations§
impl Copy for Playback
impl Eq for Playback
impl StructuralPartialEq for Playback
Auto Trait Implementations§
impl Freeze for Playback
impl RefUnwindSafe for Playback
impl Send for Playback
impl Sync for Playback
impl Unpin for Playback
impl UnsafeUnpin for Playback
impl UnwindSafe for Playback
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.