osdm_sys/models/
document_format.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum DocumentFormat {
18 #[serde(rename = "application/pdf")]
19 ApplicationSlashPdf,
20 #[serde(rename = "application/vnd.apple.pkpass")]
21 ApplicationSlashVndApplePkpass,
22 #[serde(rename = "image/jpeg")]
23 ImageSlashJpeg,
24 #[serde(rename = "image/png")]
25 ImageSlashPng,
26 #[serde(rename = "text/calendar")]
27 TextSlashCalendar,
28 #[serde(rename = "text/html")]
29 TextSlashHtml,
30
31}
32
33impl std::fmt::Display for DocumentFormat {
34 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35 match self {
36 Self::ApplicationSlashPdf => write!(f, "application/pdf"),
37 Self::ApplicationSlashVndApplePkpass => write!(f, "application/vnd.apple.pkpass"),
38 Self::ImageSlashJpeg => write!(f, "image/jpeg"),
39 Self::ImageSlashPng => write!(f, "image/png"),
40 Self::TextSlashCalendar => write!(f, "text/calendar"),
41 Self::TextSlashHtml => write!(f, "text/html"),
42 }
43 }
44}
45
46impl Default for DocumentFormat {
47 fn default() -> DocumentFormat {
48 Self::ApplicationSlashPdf
49 }
50}
51