pub struct Fragment {
pub surface: Surface,
pub nodes: Vec<LayoutNode>,
pub source_map: SourceMap,
pub metadata: FragmentMetadata,
}Expand description
A complete renderer neutral layout result for one TeX/LaTeX fragment.
Fields§
§surface: SurfaceFragment coordinate surface dimensions.
nodes: Vec<LayoutNode>All layout nodes in this fragment.
source_map: SourceMapSource map relating nodes back to input positions.
metadata: FragmentMetadataMetadata about the engine and format that produced this fragment.
Implementations§
Source§impl Fragment
impl Fragment
Sourcepub fn node(&self, node: NodeId) -> Option<&LayoutNode>
pub fn node(&self, node: NodeId) -> Option<&LayoutNode>
Returns the layout node with the given identifier, if present.
Sourcepub fn source_entries_for_node(
&self,
node: NodeId,
) -> impl Iterator<Item = &SourceMapEntry>
pub fn source_entries_for_node( &self, node: NodeId, ) -> impl Iterator<Item = &SourceMapEntry>
Iterates all source map entries for the given node.
Sourcepub fn source_origins_for_node(
&self,
node: NodeId,
) -> impl Iterator<Item = SourceOrigin<'_>>
pub fn source_origins_for_node( &self, node: NodeId, ) -> impl Iterator<Item = SourceOrigin<'_>>
Iterates resolved source origins for the given node.
Sourcepub fn source_origin_for_entry(
&self,
entry: &SourceMapEntry,
) -> Option<SourceOrigin<'_>>
pub fn source_origin_for_entry( &self, entry: &SourceMapEntry, ) -> Option<SourceOrigin<'_>>
Resolves a source map entry to its origin metadata.
Sourcepub fn primary_source_for_node(&self, node: NodeId) -> Option<SourceRange>
pub fn primary_source_for_node(&self, node: NodeId) -> Option<SourceRange>
Returns the primary source range for the given node, if any.
Sourcepub fn glyph_source_range(
&self,
node: NodeId,
glyph_index: usize,
) -> Option<SourceRange>
pub fn glyph_source_range( &self, node: NodeId, glyph_index: usize, ) -> Option<SourceRange>
Resolves the glyph cluster byte span to a SourceRange using the node’s primary source.
Sourcepub fn glyph_source_origin(
&self,
node: NodeId,
glyph_index: usize,
) -> Option<SourceOrigin<'_>>
pub fn glyph_source_origin( &self, node: NodeId, glyph_index: usize, ) -> Option<SourceOrigin<'_>>
Resolves a glyph’s source cluster to a full SourceOrigin.
Trait Implementations§
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl Freeze for Fragment
impl RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnsafeUnpin for Fragment
impl UnwindSafe for Fragment
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