drive_v3/objects/alt.rs
1use std::fmt;
2use serde::{Serialize, Deserialize};
3
4/// Alternative response formats.
5///
6/// Default: [`Json`](Alt::Json).
7#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub enum Alt {
10 /// JSON
11 #[default]
12 Json,
13
14 /// Media
15 Media
16}
17
18impl fmt::Display for Alt {
19 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
20 let string = match self {
21 Self::Json => "json",
22 Self::Media => "media",
23 };
24
25 write!(f, "{}", string)
26 }
27}