pub struct SeleneDaemon { /* 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 SeleneDaemon
impl SeleneDaemon
Sourcepub fn connect<F>(callback: Option<F>) -> Result<SeleneDaemon, IpcHandleError>
pub fn connect<F>(callback: Option<F>) -> Result<SeleneDaemon, 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)
Source§impl SeleneDaemon
impl SeleneDaemon
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: Collectable)
pub fn ipc_stop(&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_rebuild(&self)
pub fn ipc_tracklist_seek( &self, index: isize, increment: bool, ) -> Result<usize, PacketError>
pub fn ipc_query( &self, flags: PlayerQueryFlags, ) -> Result<QueryResult, PacketError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SeleneDaemon
impl RefUnwindSafe for SeleneDaemon
impl Send for SeleneDaemon
impl Sync for SeleneDaemon
impl Unpin for SeleneDaemon
impl UnsafeUnpin for SeleneDaemon
impl UnwindSafe for SeleneDaemon
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