pub struct Captions {
pub style: TextStyle,
pub styles: BTreeMap<String, TextStylePatch>,
pub cues: Vec<CaptionCue>,
}Expand description
What a caption track shows: its cues, in its style.
Fields§
§style: TextStyleThe style every cue starts from.
styles: BTreeMap<String, TextStylePatch>Named changes to style for cues that name one or whose speaker has one. At most
MAX_CAPTION_STYLES, names 1 to 64 bytes.
cues: Vec<CaptionCue>Cues in timeline order, none overlapping; a track shows one cue at a time.
Implementations§
Source§impl Captions
impl Captions
Sourcepub fn cue_patch(&self, cue: &CaptionCue) -> Option<&TextStylePatch>
pub fn cue_patch(&self, cue: &CaptionCue) -> Option<&TextStylePatch>
The patch cue cue takes: the style it names, else its speaker’s if the track has one,
else none.
Sourcepub fn cue_style(&self, cue: &CaptionCue) -> Cow<'_, TextStyle>
pub fn cue_style(&self, cue: &CaptionCue) -> Cow<'_, TextStyle>
The style cue cue draws in: the track’s, with its patch applied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Captions
impl<'de> Deserialize<'de> for Captions
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 StructuralPartialEq for Captions
Auto Trait Implementations§
impl Freeze for Captions
impl RefUnwindSafe for Captions
impl Send for Captions
impl Sync for Captions
impl Unpin for Captions
impl UnsafeUnpin for Captions
impl UnwindSafe for Captions
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