pub enum PlaybackState {
Idle,
Loading,
Playing,
Paused,
Ended,
Failed(MediaError),
}Expand description
What the player is doing.
Variants§
Idle
Nothing is open.
Loading
An item is opening or refilling its buffer. A separate state rather than a gap, because opening a network item takes long enough that a screen has to say so.
Playing
Sound is coming out.
Paused
An item is open and positioned, and stopped.
Ended
The item played to its end. Distinct from Paused:
this is what advances a playlist.
Failed(MediaError)
The item could not be played, or playback ended in a failure.
Implementations§
Source§impl PlaybackState
impl PlaybackState
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether sound is coming out now.
Sourcepub fn failure(&self) -> Option<&MediaError>
pub fn failure(&self) -> Option<&MediaError>
The failure, if playback ended in one.
Trait Implementations§
Source§impl Clone for PlaybackState
impl Clone for PlaybackState
Source§fn clone(&self) -> PlaybackState
fn clone(&self) -> PlaybackState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlaybackState
impl Debug for PlaybackState
Source§impl Default for PlaybackState
impl Default for PlaybackState
Source§fn default() -> PlaybackState
fn default() -> PlaybackState
Returns the “default value” for a type. Read more
impl Eq for PlaybackState
Source§impl PartialEq for PlaybackState
impl PartialEq for PlaybackState
impl StructuralPartialEq for PlaybackState
Auto Trait Implementations§
impl Freeze for PlaybackState
impl RefUnwindSafe for PlaybackState
impl Send for PlaybackState
impl Sync for PlaybackState
impl Unpin for PlaybackState
impl UnsafeUnpin for PlaybackState
impl UnwindSafe for PlaybackState
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