pub struct PlayerHub { /* private fields */ }Expand description
Stateful playback engine activation with queue and playlist management.
Implementations§
Source§impl PlayerHub
impl PlayerHub
Sourcepub async fn new(client: Arc<MonoClient>) -> Self
pub async fn new(client: Arc<MonoClient>) -> Self
Create a new PlayerHub from a shared MonoClient.
Sourcepub fn plugin_children(&self) -> Vec<ChildSummary>
pub fn plugin_children(&self) -> Vec<ChildSummary>
Return child activation summaries for schema discovery
Source§impl PlayerHub
impl PlayerHub
Sourcepub async fn play(
&self,
id: u64,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn play( &self, id: u64, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Play a track immediately (stops current playback)
Sourcepub async fn next(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn next(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
Skip to next track in queue
Sourcepub async fn previous(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn previous(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
Go to previous track
Sourcepub async fn volume(
&self,
level: f32,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn volume( &self, level: f32, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Set volume level
Sourcepub async fn preamp(
&self,
level: f32,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn preamp( &self, level: f32, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Set pre-amp gain level
Sourcepub async fn queue_album(
&self,
id: u64,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_album( &self, id: u64, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Add an entire album to the playback queue
Sourcepub async fn queue_add(
&self,
id: u64,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_add( &self, id: u64, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Add a track to the playback queue
Sourcepub async fn queue_batch(
&self,
ids: Vec<u64>,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_batch( &self, ids: Vec<u64>, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Add multiple tracks to the queue at once
Sourcepub async fn queue_clear(
&self,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_clear( &self, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Clear the playback queue
Sourcepub async fn queue_get(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_get(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
List queue contents
Sourcepub async fn queue_reorder(
&self,
from: u32,
to: u32,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn queue_reorder( &self, from: u32, to: u32, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Reorder tracks in the queue
Sourcepub async fn status(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn status(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
Get current playback status (single snapshot, returns immediately)
Sourcepub async fn now_playing(
&self,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn now_playing( &self, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Stream now-playing updates (~1s while playing)
Trait Implementations§
Source§impl Activation for PlayerHub
impl Activation for PlayerHub
type Methods = PlayerHubMethod
fn namespace(&self) -> &str
fn version(&self) -> &str
Source§fn description(&self) -> &str
fn description(&self) -> &str
Short description (max 15 words)
Source§fn long_description(&self) -> Option<&str>
fn long_description(&self) -> Option<&str>
Long description (optional, for detailed documentation)
fn methods(&self) -> Vec<&str>
fn method_help(&self, method: &str) -> Option<String>
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn into_rpc_methods(self) -> Methods
Source§fn plugin_schema(&self) -> PluginSchema
fn plugin_schema(&self) -> PluginSchema
Return this activation’s schema (methods + optional children)
Source§fn plugin_id(&self) -> Uuid
fn plugin_id(&self) -> Uuid
Stable activation instance ID for handle routing
By default generates a deterministic UUID from namespace+major_version
Using major version only ensures handles survive minor/patch upgrades (semver)
fn resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 Handle,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§impl ChildRouter for PlayerHub
impl ChildRouter for PlayerHub
Source§fn router_namespace(&self) -> &str
fn router_namespace(&self) -> &str
Get the namespace of this router (for error messages)
Source§fn router_call<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn router_call<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Call a method on this router
Source§impl PlayerHubRpcServer for PlayerHub
impl PlayerHubRpcServer for PlayerHub
Source§fn play<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn play<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Play a track immediately (stops current playback)
Source§fn pause<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pause<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Pause playback
Source§fn resume<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resume<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resume playback
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop playback
Source§fn next<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Skip to next track in queue
Source§fn previous<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn previous<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Go to previous track
Source§fn volume<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
level: f32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
level: f32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set volume level
Source§fn preamp<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
level: f32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn preamp<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
level: f32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set pre-amp gain level
Source§fn queue_album<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_album<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add an entire album to the playback queue
Source§fn queue_add<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_add<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a track to the playback queue
Source§fn queue_batch<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
ids: Vec<u64>,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_batch<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
ids: Vec<u64>,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add multiple tracks to the queue at once
Source§fn queue_clear<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_clear<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear the playback queue
Source§fn queue_get<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_get<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List queue contents
Source§fn queue_reorder<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
from: u32,
to: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn queue_reorder<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
from: u32,
to: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reorder tracks in the queue
Source§fn status<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current playback status (single snapshot, returns immediately)
Source§fn now_playing<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn now_playing<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream now-playing updates (~1s while playing)
Auto Trait Implementations§
impl Freeze for PlayerHub
impl !RefUnwindSafe for PlayerHub
impl Send for PlayerHub
impl Sync for PlayerHub
impl Unpin for PlayerHub
impl UnsafeUnpin for PlayerHub
impl !UnwindSafe for PlayerHub
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,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.