pub struct Chapter {
pub start_time: f64,
pub end_time: f64,
pub title: Option<String>,
}Expand description
Represents a chapter in a YouTube video.
Fields§
§start_time: f64The start time of the chapter in seconds.
end_time: f64The end time of the chapter in seconds.
title: Option<String>The title of the chapter.
Implementations§
Source§impl Chapter
impl Chapter
Sourcepub fn duration(&self) -> f64
pub fn duration(&self) -> f64
Returns the duration of the chapter in seconds.
§Returns
The duration in seconds (end_time - start_time)
Sourcepub fn duration_minutes(&self) -> f64
pub fn duration_minutes(&self) -> f64
Sourcepub fn contains_timestamp(&self, timestamp: f64) -> bool
pub fn contains_timestamp(&self, timestamp: f64) -> bool
Sourcepub fn title_contains(&self, query: &str) -> bool
pub fn title_contains(&self, query: &str) -> bool
Sourcepub fn title_matches(&self, query: &str) -> bool
pub fn title_matches(&self, query: &str) -> bool
Sourcepub fn title_starts_with(&self, prefix: &str) -> bool
pub fn title_starts_with(&self, prefix: &str) -> bool
Sourcepub fn duration_in_range(&self, min_duration: f64, max_duration: f64) -> bool
pub fn duration_in_range(&self, min_duration: f64, max_duration: f64) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chapter
impl<'de> Deserialize<'de> for Chapter
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
Auto Trait Implementations§
impl Freeze for Chapter
impl RefUnwindSafe for Chapter
impl Send for Chapter
impl Sync for Chapter
impl Unpin for Chapter
impl UnsafeUnpin for Chapter
impl UnwindSafe for Chapter
Blanket Implementations§
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.