pub struct Subtitle {
pub language_code: Option<String>,
pub language_name: Option<String>,
pub url: String,
pub extension: Extension,
pub is_automatic: bool,
}Expand description
Represents a subtitle (user-uploaded or automatic caption) for a video.
Fields§
§language_code: Option<String>The language code of the subtitle (e.g., ‘en’, ‘fr’, ‘es’).
language_name: Option<String>The full language name (e.g., ‘English’, ‘French’, ‘Spanish’).
url: StringThe URL of the subtitle file.
extension: ExtensionThe file extension/format of the subtitle.
is_automatic: boolWhether this is an automatically generated subtitle.
Implementations§
Source§impl Subtitle
impl Subtitle
Sourcepub fn from_automatic_caption(
caption: &AutomaticCaption,
language_code: String,
) -> Self
pub fn from_automatic_caption( caption: &AutomaticCaption, language_code: String, ) -> Self
Creates a new Subtitle from an AutomaticCaption, marking it as automatically generated.
§Arguments
caption- The automatic caption to convert.language_code- The language code to assign (e.g."en","fr").
§Returns
A Subtitle with is_automatic set to true.
Sourcepub fn file_extension(&self) -> &str
pub fn file_extension(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subtitle
impl<'de> Deserialize<'de> for Subtitle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Subtitle
impl StructuralPartialEq for Subtitle
Auto Trait Implementations§
impl Freeze for Subtitle
impl RefUnwindSafe for Subtitle
impl Send for Subtitle
impl Sync for Subtitle
impl Unpin for Subtitle
impl UnsafeUnpin for Subtitle
impl UnwindSafe for Subtitle
Blanket Implementations§
impl<T> AllTraits for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CommonTraits for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.