#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
missing_debug_implementations,
missing_docs
)]
mod datatypes;
mod discovery;
mod snapshot;
mod speaker;
mod track;
mod utils;
pub use datatypes::{RepeatMode, SpeakerInfo};
pub use discovery::{discover, find};
pub use rupnp::{self, ssdp::URN};
pub use snapshot::Snapshot;
pub use speaker::Speaker;
use thiserror::*;
pub use track::{Track, TrackInfo};
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
UPnP(#[from] rupnp::Error),
#[error(transparent)]
Xml(#[from] roxmltree::Error),
#[error(transparent)]
InvalidUri(#[from] http::uri::InvalidUri),
#[error("Service {service} was not found when performing {action} with {payload}")]
MissingServiceForUPnPAction {
service: URN,
action: String,
payload: String,
},
#[error("asked for zone group state but the speaker doesn't seem to be included there")]
SpeakerNotIncludedInOwnZoneGroupState,
#[error("The Sonos-specific GetZoneGroupState action returned non-Sonos devices")]
GetZoneGroupStateReturnedNonSonos,
#[error("UPnP discovery for Sonos devices returned non-Sonos devices")]
NonSonosDevicesInSonosUPnPDiscovery,
}
type Result<T, E = Error> = std::result::Result<T, E>;