pub struct PlaylistHub { /* private fields */ }Expand description
Persistent playlist management activation
Implementations§
Source§impl PlaylistHub
impl PlaylistHub
Source§impl PlaylistHub
impl PlaylistHub
Sourcepub async fn create(
&self,
name: String,
description: Option<String>,
ids: Option<Vec<u64>>,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn create( &self, name: String, description: Option<String>, ids: Option<Vec<u64>>, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Create an empty or pre-populated playlist
Sourcepub async fn list(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn list(&self) -> impl Stream<Item = MonoEvent> + Send + 'static
List all saved playlists
Sourcepub async fn show(
&self,
name: String,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn show( &self, name: String, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Get full playlist info (metadata + tracks) — suitable for UI rendering
Sourcepub async fn delete(
&self,
name: String,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn delete( &self, name: String, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Delete a playlist
Sourcepub async fn rename(
&self,
name: String,
new_name: String,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn rename( &self, name: String, new_name: String, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Rename a playlist
Sourcepub async fn add(
&self,
name: String,
id: u64,
quality: Option<String>,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn add( &self, name: String, id: u64, quality: Option<String>, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Add a track to a playlist by ID
Sourcepub async fn remove(
&self,
name: String,
index: u32,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn remove( &self, name: String, index: u32, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Remove a track from a playlist by index
Sourcepub async fn describe(
&self,
name: String,
description: String,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn describe( &self, name: String, description: String, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Set or update a playlist’s description
Sourcepub async fn reorder(
&self,
name: String,
from: u32,
to: u32,
) -> impl Stream<Item = MonoEvent> + Send + 'static
pub async fn reorder( &self, name: String, from: u32, to: u32, ) -> impl Stream<Item = MonoEvent> + Send + 'static
Reorder a track within a playlist
Trait Implementations§
Source§impl Activation for PlaylistHub
impl Activation for PlaylistHub
type Methods = PlaylistHubMethod
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 PlaylistHub
impl ChildRouter for PlaylistHub
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 Clone for PlaylistHub
impl Clone for PlaylistHub
Source§fn clone(&self) -> PlaylistHub
fn clone(&self) -> PlaylistHub
Returns a duplicate 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 moreSource§impl PlaylistHubRpcServer for PlaylistHub
impl PlaylistHubRpcServer for PlaylistHub
Source§fn create<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
description: Option<String>,
ids: Option<Vec<u64>>,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
description: Option<String>,
ids: Option<Vec<u64>>,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create an empty or pre-populated playlist
Source§fn list<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all saved playlists
Source§fn show<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn show<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get full playlist info (metadata + tracks) — suitable for UI rendering
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a playlist
Source§fn rename<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
new_name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rename<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
new_name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Rename a playlist
Source§fn add<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
id: u64,
quality: Option<String>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
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 a playlist by ID
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
index: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
index: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove a track from a playlist by index
Source§fn describe<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
description: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn describe<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
description: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set or update a playlist’s description
Source§fn reorder<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
from: u32,
to: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reorder<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
from: u32,
to: u32,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reorder a track within a playlist
Source§fn play<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: 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,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load a playlist into the queue and start playing
Source§fn save<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
name: String,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save the current queue as a playlist
Auto Trait Implementations§
impl Freeze for PlaylistHub
impl !RefUnwindSafe for PlaylistHub
impl Send for PlaylistHub
impl Sync for PlaylistHub
impl Unpin for PlaylistHub
impl UnsafeUnpin for PlaylistHub
impl !UnwindSafe for PlaylistHub
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.