pub struct PlayerControlTimeline { /* private fields */ }Expand description
This queue allocates its complete event storage during construction.
Implementations§
Source§impl PlayerControlTimeline
impl PlayerControlTimeline
pub fn new( capacity: usize, render_frame: u64, initial_control: PlayerControl, ) -> Result<Self, ControlTimelineCreateError>
pub fn with_policy( capacity: usize, render_frame: u64, initial_control: PlayerControl, policy: ControlTimelinePolicy, ) -> Result<Self, ControlTimelineCreateError>
pub const fn capacity(&self) -> usize
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub const fn is_full(&self) -> bool
pub const fn policy(&self) -> ControlTimelinePolicy
pub const fn render_frame(&self) -> u64
pub const fn current_control(&self) -> PlayerControl
pub fn next_event(&self) -> Option<TimedPlayerControl>
Sourcepub const fn checkpoint(&self) -> PlayerControlTimelineCheckpoint
pub const fn checkpoint(&self) -> PlayerControlTimelineCheckpoint
Captures the logical queue and render state in constant time.
This function does not allocate. Event consumption does not invalidate the result.
Sourcepub fn restore_checkpoint(
&mut self,
checkpoint: PlayerControlTimelineCheckpoint,
) -> Result<(), ControlTimelineCheckpointRestoreError>
pub fn restore_checkpoint( &mut self, checkpoint: PlayerControlTimelineCheckpoint, ) -> Result<(), ControlTimelineCheckpointRestoreError>
Restores a checkpoint in constant time.
This function does not allocate. It rejects a marker from another timeline. It also rejects a marker after a slot write.
Sourcepub fn next_transition_offset(&self, block_frame_count: u32) -> Option<u32>
pub fn next_transition_offset(&self, block_frame_count: u32) -> Option<u32>
Returns the next transition inside the half-open render block.
Sourcepub fn enqueue(
&mut self,
event: TimedPlayerControl,
) -> Result<(), ControlTimelinePushError>
pub fn enqueue( &mut self, event: TimedPlayerControl, ) -> Result<(), ControlTimelinePushError>
Adds one event without allocating or changing an accepted event.
Sourcepub fn visit_block(
&mut self,
block_frame_count: u32,
visit: impl FnMut(ControlBlockItem),
) -> Result<(), ControlTimelineAdvanceError>
pub fn visit_block( &mut self, block_frame_count: u32, visit: impl FnMut(ControlBlockItem), ) -> Result<(), ControlTimelineAdvanceError>
Visits every transition and render span in one half-open block.
Events at the block end remain pending for the next block.
pub fn snapshot(&self) -> ControlTimelineSnapshot
Sourcepub fn restore(
&mut self,
snapshot: &ControlTimelineSnapshot,
) -> Result<(), ControlTimelineRestoreError>
pub fn restore( &mut self, snapshot: &ControlTimelineSnapshot, ) -> Result<(), ControlTimelineRestoreError>
Restore validates all data before it changes the current timeline.
pub fn from_snapshot( snapshot: &ControlTimelineSnapshot, ) -> Result<Self, ControlTimelineRestoreError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlayerControlTimeline
impl RefUnwindSafe for PlayerControlTimeline
impl Send for PlayerControlTimeline
impl Sync for PlayerControlTimeline
impl Unpin for PlayerControlTimeline
impl UnsafeUnpin for PlayerControlTimeline
impl UnwindSafe for PlayerControlTimeline
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