pub enum SubtitleCodec {
Srt,
Ass,
Dvb,
Hdmv,
Webvtt,
Other(String),
}Expand description
Subtitle codec identifier.
This enum represents common subtitle codecs used in media files.
It covers text-based and bitmap-based formats while remaining extensible
via the Other variant.
Note: No Copy or Default derive because Other(String) is not Copy.
Variants§
Srt
SubRip / SRT — text-based timed subtitles
Ass
ASS/SSA (Advanced SubStation Alpha) — styled text subtitles
Dvb
DVB bitmap subtitles (digital broadcast)
Hdmv
HDMV/PGS — Blu-ray bitmap subtitles
Webvtt
WebVTT — web-standard text subtitles
Other(String)
Unrecognized codec; raw codec name stored for transparency
Implementations§
Source§impl SubtitleCodec
impl SubtitleCodec
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the codec name as a short string.
§Examples
use ff_format::codec::SubtitleCodec;
assert_eq!(SubtitleCodec::Srt.name(), "srt");
assert_eq!(SubtitleCodec::Ass.name(), "ass");Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Returns the human-readable display name for the codec.
§Examples
use ff_format::codec::SubtitleCodec;
assert_eq!(SubtitleCodec::Srt.display_name(), "SubRip (SRT)");
assert_eq!(SubtitleCodec::Hdmv.display_name(), "HDMV/PGS");Sourcepub fn is_text_based(&self) -> bool
pub fn is_text_based(&self) -> bool
Returns true if this is a text-based subtitle codec.
§Examples
use ff_format::codec::SubtitleCodec;
assert!(SubtitleCodec::Srt.is_text_based());
assert!(SubtitleCodec::Ass.is_text_based());
assert!(!SubtitleCodec::Dvb.is_text_based());Sourcepub fn is_bitmap_based(&self) -> bool
pub fn is_bitmap_based(&self) -> bool
Returns true if this is a bitmap-based subtitle codec.
§Examples
use ff_format::codec::SubtitleCodec;
assert!(SubtitleCodec::Dvb.is_bitmap_based());
assert!(SubtitleCodec::Hdmv.is_bitmap_based());
assert!(!SubtitleCodec::Srt.is_bitmap_based());Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if the codec is unrecognized.
§Examples
use ff_format::codec::SubtitleCodec;
assert!(SubtitleCodec::Other("dvd_subtitle".to_string()).is_unknown());
assert!(!SubtitleCodec::Srt.is_unknown());Trait Implementations§
Source§impl Clone for SubtitleCodec
impl Clone for SubtitleCodec
Source§fn clone(&self) -> SubtitleCodec
fn clone(&self) -> SubtitleCodec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubtitleCodec
impl Debug for SubtitleCodec
Source§impl Display for SubtitleCodec
impl Display for SubtitleCodec
impl Eq for SubtitleCodec
Source§impl Hash for SubtitleCodec
impl Hash for SubtitleCodec
Source§impl PartialEq for SubtitleCodec
impl PartialEq for SubtitleCodec
Source§fn eq(&self, other: &SubtitleCodec) -> bool
fn eq(&self, other: &SubtitleCodec) -> bool
self and other values to be equal, and is used by ==.