Enum PlayerState
#[repr(u32)]pub enum PlayerState {
Idle = 0,
Playing = 1,
Paused = 2,
Buffering = 3,
Error = 4,
}
Expand description
State of a media player.
Variants§
Idle = 0
The initial state of a session if there is no associated media.
Playing = 1
The player is playing.
Paused = 2
The player is paused.
Buffering = 3
The player would be playing, but is temporarily paused for buffering.
Error = 4
The player cannot recover from this state and will close.
Implementations§
§impl PlayerState
impl PlayerState
pub fn from_primitive(prim: u32) -> Option<PlayerState>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
§impl Clone for PlayerState
impl Clone for PlayerState
§fn clone(&self) -> PlayerState
fn clone(&self) -> PlayerState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for PlayerState
impl Debug for PlayerState
§impl<D> Decode<PlayerState, D> for PlayerStatewhere
D: ResourceDialect,
impl<D> Decode<PlayerState, D> for PlayerStatewhere
D: ResourceDialect,
§fn new_empty() -> PlayerState
fn new_empty() -> PlayerState
Creates a valid instance of
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<PlayerState, D> for PlayerStatewhere
D: ResourceDialect,
impl<D> Encode<PlayerState, D> for PlayerStatewhere
D: ResourceDialect,
§impl Hash for PlayerState
impl Hash for PlayerState
§impl Ord for PlayerState
impl Ord for PlayerState
§impl PartialEq for PlayerState
impl PartialEq for PlayerState
§impl PartialOrd for PlayerState
impl PartialOrd for PlayerState
§impl TypeMarker for PlayerState
impl TypeMarker for PlayerState
§type Owned = PlayerState
type Owned = PlayerState
The owned Rust type which this FIDL type decodes into.
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for PlayerState
impl ValueTypeMarker for PlayerState
§type Borrowed<'a> = PlayerState
type Borrowed<'a> = PlayerState
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<PlayerState as TypeMarker>::Owned,
) -> <PlayerState as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<PlayerState as TypeMarker>::Owned, ) -> <PlayerState as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.impl Copy for PlayerState
impl Eq for PlayerState
impl StructuralPartialEq for PlayerState
Auto Trait Implementations§
impl Freeze for PlayerState
impl RefUnwindSafe for PlayerState
impl Send for PlayerState
impl Sync for PlayerState
impl Unpin for PlayerState
impl UnwindSafe for PlayerState
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