pub struct Captions {
pub style: TextStyle,
pub styles: BTreeMap<String, TextStylePatch>,
pub cues: Vec<CaptionCue>,
pub from_words: Option<CaptionsFromWords>,
}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. Empty when
from_words gives the cues.
from_words: Option<CaptionsFromWords>Cues built at evaluation from a words data set, instead of cues.
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 Forget for Captions
impl Freeze for Captionswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<GradientStop>: Freeze,
PhantomData<TextStroke>: Freeze,
PhantomData<TextShadow>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<TextAnimator>: Freeze,
*const LeafNode<String, TextStylePatch> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, TextStylePatch)>>: Freeze,
PhantomData<CaptionCue>: Freeze,
impl Move for Captions
impl RefUnwindSafe for Captions
impl Send for Captionswhere
RawVecInner: Send,
BoxRaw<DataBinding>: Send,
NodeRef<Owned, String, TextStylePatch, LeafOrInternal>: Send,
BoxRaw<(String, TextStylePatch)>: Send,
impl Sync for Captionswhere
RawVecInner: Sync,
BoxRaw<DataBinding>: Sync,
NodeRef<Owned, String, TextStylePatch, LeafOrInternal>: Sync,
BoxRaw<(String, TextStylePatch)>: Sync,
impl Unpin for Captionswhere
*const u8 is !null: Unpin,
Box<DataBinding>: Unpin,
*const LeafNode<String, TextStylePatch> is !null: Unpin,
Box<(String, TextStylePatch)>: Unpin,
impl UnsafeUnpin for Captionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<GradientStop>: UnsafeUnpin,
PhantomData<TextStroke>: UnsafeUnpin,
PhantomData<TextShadow>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<TextAnimator>: UnsafeUnpin,
*const LeafNode<String, TextStylePatch> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, TextStylePatch)>>: UnsafeUnpin,
PhantomData<CaptionCue>: UnsafeUnpin,
impl UnwindSafe for Captionswhere
RawVecInner: UnwindSafe,
BoxRaw<DataBinding>: UnwindSafe,
BTreeMap<String, TextStylePatch>: UnwindSafe,
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