Skip to main content

async_openai/types/videos/
impls.rs

1use std::fmt::Display;
2
3use crate::types::videos::{VideoSeconds, VideoSize, VideoStatus};
4
5impl Display for VideoSize {
6    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7        write!(
8            f,
9            "{}",
10            match self {
11                Self::S720x1280 => "720x1280",
12                Self::S1280x720 => "1280x720",
13                Self::S1024x1792 => "1024x1792",
14                Self::S1792x1024 => "1792x1024",
15            }
16        )
17    }
18}
19
20impl Display for VideoSeconds {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22        write!(
23            f,
24            "{}",
25            match self {
26                Self::Four => "4",
27                Self::Eight => "8",
28                Self::Twelve => "12",
29                Self::Sixteen => "16",
30                Self::Twenty => "20",
31                Self::Other(other) => other,
32            }
33        )
34    }
35}
36
37impl Display for VideoStatus {
38    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
39        write!(
40            f,
41            "{}",
42            match self {
43                Self::Queued => "queued",
44                Self::InProgress => "in_progress",
45                Self::Completed => "completed",
46                Self::Failed => "failed",
47            }
48        )
49    }
50}