#[non_exhaustive]pub struct Document {
pub tt: TtElement,
pub xml_declaration: Option<XmlDeclaration>,
}Expand description
A parsed TTML document.
This is the top-level type. Create one with Document::parse_str.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tt: TtElementThe root <tt> element.
xml_declaration: Option<XmlDeclaration>Any XML declaration attributes (version, encoding).
Implementations§
Source§impl Document
impl Document
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty document for from-scratch construction.
Use this to build TTML documents programmatically.
Fields marked #[non_exhaustive] can be constructed using
..Default::default() where Default is implemented.
Sourcepub fn time_context(&self) -> TimeContext
pub fn time_context(&self) -> TimeContext
Get the effective time context from the root <tt> element’s parameter attributes.
Trait Implementations§
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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