use std::sync::Arc;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Format(Arc<str>);
impl Format {
pub fn new(id: impl Into<Arc<str>>) -> Self {
Self(id.into())
}
pub fn id(&self) -> &str {
&self.0
}
}
impl std::fmt::Display for Format {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
pub const MP4: &str = "mp4";
pub const MKV: &str = "mkv";
pub const WEBM: &str = "webm";
pub const AVI: &str = "avi";
pub const MOV: &str = "mov";
pub const FLV: &str = "flv";
pub const TS: &str = "ts";
pub const M4V: &str = "m4v";
pub const WMV: &str = "wmv";
pub const MP3: &str = "mp3";
pub const WAV: &str = "wav";
pub const FLAC: &str = "flac";
pub const OGG: &str = "ogg";
pub const AAC: &str = "aac";
pub const M4A: &str = "m4a";
pub const WMA: &str = "wma";
pub const OPUS: &str = "opus";
pub const PNG: &str = "png";
pub const JPEG: &str = "jpeg";
pub const WEBP: &str = "webp";
pub const GIF: &str = "gif";
pub const BMP: &str = "bmp";
pub const TIFF: &str = "tiff";
pub const SVG: &str = "svg";
pub const AVIF: &str = "avif";
pub const HEIF: &str = "heif";
pub const SRT: &str = "srt";
pub const VTT: &str = "vtt";
pub const ASS: &str = "ass";