vrchatapi/models/
mime_type.rs1use crate::models;
10use serde::{Deserialize, Serialize};
11
12#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
13pub enum MimeType {
14 #[serde(rename = "image/jpeg")]
15 ImageSlashJpeg,
16 #[serde(rename = "image/jpg")]
17 ImageSlashJpg,
18 #[serde(rename = "image/png")]
19 ImageSlashPng,
20 #[serde(rename = "image/webp")]
21 ImageSlashWebp,
22 #[serde(rename = "image/gif")]
23 ImageSlashGif,
24 #[serde(rename = "image/bmp")]
25 ImageSlashBmp,
26 #[serde(rename = "image/svg+xml")]
27 ImageSlashSvgxml,
28 #[serde(rename = "image/tiff")]
29 ImageSlashTiff,
30 #[serde(rename = "application/x-avatar")]
31 ApplicationSlashXAvatar,
32 #[serde(rename = "application/x-world")]
33 ApplicationSlashXWorld,
34 #[serde(rename = "application/gzip")]
35 ApplicationSlashGzip,
36 #[serde(rename = "application/x-rsync-signature")]
37 ApplicationSlashXRsyncSignature,
38 #[serde(rename = "application/x-rsync-delta")]
39 ApplicationSlashXRsyncDelta,
40 #[serde(rename = "application/octet-stream")]
41 ApplicationSlashOctetStream,
42}
43
44impl std::fmt::Display for MimeType {
45 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
46 match self {
47 Self::ImageSlashJpeg => write!(f, "image/jpeg"),
48 Self::ImageSlashJpg => write!(f, "image/jpg"),
49 Self::ImageSlashPng => write!(f, "image/png"),
50 Self::ImageSlashWebp => write!(f, "image/webp"),
51 Self::ImageSlashGif => write!(f, "image/gif"),
52 Self::ImageSlashBmp => write!(f, "image/bmp"),
53 Self::ImageSlashSvgxml => write!(f, "image/svg+xml"),
54 Self::ImageSlashTiff => write!(f, "image/tiff"),
55 Self::ApplicationSlashXAvatar => write!(f, "application/x-avatar"),
56 Self::ApplicationSlashXWorld => write!(f, "application/x-world"),
57 Self::ApplicationSlashGzip => write!(f, "application/gzip"),
58 Self::ApplicationSlashXRsyncSignature => write!(f, "application/x-rsync-signature"),
59 Self::ApplicationSlashXRsyncDelta => write!(f, "application/x-rsync-delta"),
60 Self::ApplicationSlashOctetStream => write!(f, "application/octet-stream"),
61 }
62 }
63}
64
65impl Default for MimeType {
66 fn default() -> MimeType {
67 Self::ImageSlashJpeg
68 }
69}