pub struct SeleneClient { /* private fields */ }Expand description
Daemon connection abstraction
Allow clients to connect to selene-daemon using one of the handles compatible with their system. Defines wrapper functions around all IPC calls to allow for easy get/set calls
Implementations§
Source§impl SeleneClient
impl SeleneClient
pub fn ipc_generic(&self, command: IpcCommand) -> Result<(), PacketError>
pub fn ipc_flush(&self) -> Result<(), PacketError>
pub fn ipc_disconnect(&self)
pub fn ipc_reload_config(&self) -> Result<Result<(), String>, PacketError>
pub fn ipc_play(&self, collectable: Vec<Collectable>)
pub fn ipc_stop(&self)
pub fn ipc_next(&self)
pub fn ipc_previous(&self)
pub fn ipc_set_is_playing(&self, is_playing: bool)
pub fn ipc_toggle_is_playing(&self) -> Result<PlaybackStatus, PacketError>
pub fn ipc_seek( &self, time: f64, increment: bool, ) -> Result<Option<f64>, PacketError>
pub fn ipc_set_volume( &self, volume: f32, increment: bool, ) -> Result<f32, PacketError>
pub fn ipc_queue_set( &self, tracks: Vec<Collectable>, expected_state: Hash, ) -> Result<bool, PacketError>
pub fn ipc_queue_extend(&self, tracks: Vec<Collectable>)
pub fn ipc_queue_shuffle(&self)
pub fn ipc_queue_clear(&self)
pub fn ipc_playlist_set( &self, collectables: Vec<Collectable>, expected_state: Hash, ) -> Result<bool, PacketError>
pub fn ipc_playlist_extend(&self, collectables: Vec<Collectable>)
pub fn ipc_playlist_clear(&self)
pub fn ipc_playlist_set_shuffle_mode(&self, shuffle_mode: ShuffleMode)
pub fn ipc_playlist_set_loop_mode(&self, loop_mode: LoopMode)
pub fn ipc_tracklist_seek( &self, index: isize, increment: bool, ) -> Result<usize, PacketError>
pub fn ipc_query( &self, flags: PlayerQueryFlags, ) -> Result<QueryResult, PacketError>
Source§impl SeleneClient
impl SeleneClient
Sourcepub fn connect<F>(event_callback: F) -> Result<SeleneClient, IpcHandleError>
pub fn connect<F>(event_callback: F) -> Result<SeleneClient, IpcHandleError>
Create a new connection to the daemon
§Errors
This function will error if:
- There is no [
DaemonHandle] configured for the current system - The connection could not be established (May be because the daemon is not running)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SeleneClient
impl RefUnwindSafe for SeleneClient
impl Send for SeleneClient
impl Sync for SeleneClient
impl Unpin for SeleneClient
impl UnsafeUnpin for SeleneClient
impl UnwindSafe for SeleneClient
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more