drive_v3/objects/
thumbnail.rs1use std::fmt;
2
3use serde::{Serialize, Deserialize};
4
5#[derive(Default, Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct Thumbnail {
11 #[serde(skip_serializing_if = "Option::is_none")]
13 pub image: Option<String>,
14
15 #[serde(skip_serializing_if = "Option::is_none")]
17 pub mime_type: Option<String>,
18}
19
20impl fmt::Display for Thumbnail {
21 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
22 let json = serde_json::to_string_pretty(&self)
23 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
24
25 write!(f, "{}", json)
26 }
27}
28
29impl Thumbnail {
30 pub fn new() -> Self {
32 Self { ..Default::default() }
33 }
34}