Skip to main content

rskit_dataset/
media.rs

1use serde::{Deserialize, Serialize};
2
3/// Supported media types.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
5#[non_exhaustive]
6pub enum MediaType {
7    /// Image sample.
8    Image,
9    /// Text sample.
10    Text,
11    /// Audio sample.
12    Audio,
13    /// Video sample.
14    Video,
15}
16
17impl std::fmt::Display for MediaType {
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19        match self {
20            MediaType::Image => write!(f, "image"),
21            MediaType::Text => write!(f, "text"),
22            MediaType::Audio => write!(f, "audio"),
23            MediaType::Video => write!(f, "video"),
24        }
25    }
26}