pub enum Command {
Show 18 variants
Play {
slug: Option<String>,
},
Pause,
Toggle,
Stop,
Seek {
position_secs: Option<f64>,
delta_secs: Option<f64>,
},
Next,
Previous,
Download {
slug: String,
},
CancelDownload {
slug: String,
},
DeleteDownload {
slug: String,
},
Favourite {
slug: String,
},
Unfavourite {
slug: String,
},
ListFavourites,
Preferences {
inverted_palette: Option<bool>,
},
Status,
ListCatalog,
Subscribe {
spectrum: bool,
},
Shutdown,
}Expand description
The command surface the daemon accepts.
Variants§
Play
Start the named episode, or resume the loaded one when no slug is given.
Pause
Toggle
Stop
Seek
Seek to an absolute position or by a signed offset. Exactly one of the two.
Next
Previous
Download
Begin or resume an offline download; returns before the transfer finishes.
CancelDownload
DeleteDownload
Remove an episode’s local copy, so no client has to unlink a file the daemon is accounting for.
Favourite
Mark an episode a favourite. Marking one already marked is not an error.
Unfavourite
Unmark a favourite. Unmarking one not marked is not an error.
ListFavourites
Preferences
Read the interface’s display preferences, and set whichever of them are given.
One command rather than a read and a write: an omitted field is left alone, so a read is this command with the field absent and a client never has to read a preference back before changing it. These belong to the interface, not to playback, and setting one has no effect on what the daemon is playing.
Unknown fields are ignored, so a client still sending the cookie notice’s dismissal - a preference this interface no longer has - is answered rather than refused.
Status
ListCatalog
Return the catalog the daemon holds, so no client has to read its cache file.
Subscribe
Start receiving pushed state events on this connection.
Fields
Shutdown
Stop audio, persist state, and exit. The only command that ends the process.
Implementations§
Source§impl Command
impl Command
pub fn type_name(&self) -> &'static str
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks arguments that parsed structurally but must still fall inside their permitted domain.
seek takes exactly one of position_secs or delta_secs, and that one must be a
duration the engine can hold. Anything else is ErrorCode::InvalidParams.