drive_v3/objects/
content_hints.rs1use std::fmt;
2use serde::{Serialize, Deserialize};
3
4use super::Thumbnail;
5
6#[derive(Default, Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct ContentHints {
10 #[serde(skip_serializing_if = "Option::is_none")]
13 pub indexable_text: Option<String>,
14
15 #[serde(skip_serializing_if = "Option::is_none")]
17 pub thumbnail: Option<Thumbnail>,
18}
19
20impl fmt::Display for ContentHints {
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 ContentHints {
30 pub fn new() -> Self {
32 Self { ..Default::default() }
33 }
34}