pub struct ToggleMpc {
pub address_and_port: String,
/* private fields */
}
Expand description
The MPD Client. It allows to toggle play and to switch playlist.
Fields§
§address_and_port: String
Implementations§
source§impl ToggleMpc
impl ToggleMpc
pub fn new(address_and_port: String, playlists: Vec<&str>) -> Self
sourcepub fn toggle_play<MC: MpdConn>(&mut self, connection: &mut MC) -> Result<()>
pub fn toggle_play<MC: MpdConn>(&mut self, connection: &mut MC) -> Result<()>
Toggles play: If MPD is in state play, it will be paused. Otherwise it will command MPD to play.
§Errors
Errors may occur using the connection to MPD. They are propagated.
sourcepub fn switch_list<MC: MpdConn>(&mut self, connection: &mut MC) -> Result<()>
pub fn switch_list<MC: MpdConn>(&mut self, connection: &mut MC) -> Result<()>
Switches playlist: Clears the current playlist, loads the next configures playlist and plays it. After the last playlist the first is played again. Before switching, the position within the playlist ist stored. When returning to this playlist, a seek is performed to continue from the last position.
§Errors
Errors may occur using the connection to MPD. They are propagated.
Auto Trait Implementations§
impl Freeze for ToggleMpc
impl RefUnwindSafe for ToggleMpc
impl Send for ToggleMpc
impl Sync for ToggleMpc
impl Unpin for ToggleMpc
impl UnwindSafe for ToggleMpc
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