rustio/codec.rs
1use restson::{Error, RestPath};
2
3#[derive(Serialize, Deserialize, Debug, Clone)]
4pub struct Codec {
5 pub value: String,
6 pub stationcount: String,
7}
8
9#[derive(Serialize, Deserialize, Debug)]
10#[serde(untagged)]
11pub enum CodecResponse {
12 Codecs(Vec<Codec>),
13 Codec(Codec),
14}
15
16impl RestPath<()> for CodecResponse {
17 fn get_path(_: ()) -> Result<String, Error> {
18 Ok(format!("webservice/json/codecs"))
19 }
20}