pub enum MediaSessionType {
Idle,
Audio {
last_item: Option<MediaItem>,
is_active: bool,
},
Movie {
item: MediaItem,
is_active: bool,
},
TvShow {
item: MediaItem,
series_id: String,
is_active: bool,
},
}Expand description
Media session type tracking the high-level playback context
Variants§
Idle
No active session - browsing library
Audio
Audio playback session (music, audiobooks, podcasts) Persists until explicitly dismissed
Fields
Movie
Movie playback (single video, auto-dismiss on end)
TvShow
TV show playback (supports next episode auto-advance)
Implementations§
Source§impl MediaSessionType
impl MediaSessionType
Sourcepub fn is_active_session(&self) -> bool
pub fn is_active_session(&self) -> bool
Check if this is an active session (any type except Idle)
Sourcepub fn is_playing_or_paused(&self) -> bool
pub fn is_playing_or_paused(&self) -> bool
Check if playback is currently active within the session
Sourcepub fn current_item(&self) -> Option<&MediaItem>
pub fn current_item(&self) -> Option<&MediaItem>
Get the current media item if any
Trait Implementations§
Source§impl Clone for MediaSessionType
impl Clone for MediaSessionType
Source§fn clone(&self) -> MediaSessionType
fn clone(&self) -> MediaSessionType
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 MediaSessionType
impl Debug for MediaSessionType
Source§impl<'de> Deserialize<'de> for MediaSessionType
impl<'de> Deserialize<'de> for MediaSessionType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl NamedType for MediaSessionType
impl NamedType for MediaSessionType
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
this is equivalent to [Type::inline] but returns a [NamedDataType] instead.
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
this is equivalent to [Type::definition] but returns a [NamedDataType] instead.
Source§impl PartialEq for MediaSessionType
impl PartialEq for MediaSessionType
Source§fn eq(&self, other: &MediaSessionType) -> bool
fn eq(&self, other: &MediaSessionType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MediaSessionType
impl Serialize for MediaSessionType
Source§impl Type for MediaSessionType
impl Type for MediaSessionType
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Returns the definition of a type using the provided generics. Read more
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
Generates a datatype corresponding to a reference to this type,
as determined by its category. Getting a reference to a type implies that
it should belong in the type map (since it has to be referenced from somewhere),
so the output of
definition will be put into the type map.impl Flatten for MediaSessionType
impl StructuralPartialEq for MediaSessionType
Auto Trait Implementations§
impl Freeze for MediaSessionType
impl RefUnwindSafe for MediaSessionType
impl Send for MediaSessionType
impl Sync for MediaSessionType
impl Unpin for MediaSessionType
impl UnsafeUnpin for MediaSessionType
impl UnwindSafe for MediaSessionType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<T> FunctionArg for Twhere
T: Type,
impl<T> FunctionArg for Twhere
T: Type,
§fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
Gets the type of an argument as a [
DataType]. Read more