Trait mpd::idle::Idle [] [src]

pub trait Idle {
    type Stream: Read + Write;
    fn idle<'a>(&'a mut self,
            subsystems: &[Subsystem])
            -> Result<IdleGuard<'a, Self::Stream>, Error>; fn wait(&mut self, subsystems: &[Subsystem]) -> Result<Vec<Subsystem>, Error> { ... } }

This trait implements idle command of MPD protocol

See module's documentation for details.

Associated Types

Stream type of a client

Required Methods

Start listening for events from a set of subsystems

If empty subsystems slice is given, wait for all event from any subsystem.

This method returns IdleGuard, which takes mutable reference of an initial client, thus disallowing any operations on this mpd connection.

You can call .get() method of this struct to stop waiting and get all queued events matching given subsystems filter. This call consumes a guard, stops waiting and releases client object.

If the guard goes out of scope, wait lock is released as well, but all queued events will be silently ignored.

Provided Methods

Wait for events from a set of subsystems and return list of affected subsystems

This is a blocking operation. If empty subsystems slice is given, wait for all event from any subsystem.

Implementors