pub struct Player<'a> { /* private fields */ }Expand description
A transcript player.
Implementations§
Source§impl<'a> Player<'a>
impl<'a> Player<'a>
Sourcepub fn new(transcript: &'a Transcript) -> Self
pub fn new(transcript: &'a Transcript) -> Self
Create a new player.
Sourcepub const fn with_options(self, options: PlaybackOptions) -> Self
pub const fn with_options(self, options: PlaybackOptions) -> Self
Set playback options.
Sourcepub const fn state(&self) -> PlayerState
pub const fn state(&self) -> PlayerState
Get current state.
Sourcepub const fn total_events(&self) -> usize
pub const fn total_events(&self) -> usize
Get total events.
Sourcepub fn current_time(&self) -> Duration
pub fn current_time(&self) -> Duration
Get current timestamp.
Sourcepub fn next_event(&mut self) -> Option<&TranscriptEvent>
pub fn next_event(&mut self) -> Option<&TranscriptEvent>
Get next event to play.
Sourcepub fn delay_to_next(&self) -> Duration
pub fn delay_to_next(&self) -> Duration
Calculate delay before next event.
Auto Trait Implementations§
impl<'a> Freeze for Player<'a>
impl<'a> RefUnwindSafe for Player<'a>
impl<'a> Send for Player<'a>
impl<'a> Sync for Player<'a>
impl<'a> Unpin for Player<'a>
impl<'a> UnwindSafe for Player<'a>
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