pub struct StructureElement {
pub structure_type: StructureType,
pub id: Option<String>,
pub attributes: StructureAttributes,
pub children: Vec<usize>,
pub mcids: Vec<MarkedContentReference>,
}Expand description
A structure element in the document structure tree
Structure elements form a hierarchical tree that describes the logical organization of the document content.
Fields§
§structure_type: StructureTypeThe structure type (either standard or custom)
id: Option<String>Element ID (optional, used for referencing)
attributes: StructureAttributesAttributes for this element
children: Vec<usize>Child elements (element IDs)
mcids: Vec<MarkedContentReference>Marked content references (MCIDs) associated with this element
Implementations§
Source§impl StructureElement
impl StructureElement
Sourcepub fn new(structure_type: StandardStructureType) -> Self
pub fn new(structure_type: StandardStructureType) -> Self
Creates a new structure element with the given type
Sourcepub fn new_custom(type_name: impl Into<String>) -> Self
pub fn new_custom(type_name: impl Into<String>) -> Self
Creates a new structure element with a custom type
Sourcepub fn with_language(self, lang: impl Into<String>) -> Self
pub fn with_language(self, lang: impl Into<String>) -> Self
Sets the language attribute
Sourcepub fn with_alt_text(self, alt: impl Into<String>) -> Self
pub fn with_alt_text(self, alt: impl Into<String>) -> Self
Sets the alt text attribute
Sourcepub fn with_actual_text(self, text: impl Into<String>) -> Self
pub fn with_actual_text(self, text: impl Into<String>) -> Self
Sets the actual text attribute
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the title attribute
Trait Implementations§
Source§impl Clone for StructureElement
impl Clone for StructureElement
Source§fn clone(&self) -> StructureElement
fn clone(&self) -> StructureElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StructureElement
impl RefUnwindSafe for StructureElement
impl Send for StructureElement
impl Sync for StructureElement
impl Unpin for StructureElement
impl UnwindSafe for StructureElement
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more