pub struct TextMark {
pub id: MarkId,
pub addr: LoweredAddr,
pub bytes: Range<usize>,
pub start: LineCol,
pub end: LineCol,
}Expand description
A position mark of the text output: where the text printed for one lowered
node is in TextOutput::text.
It holds the layout engine’s mark identifier, the lowered node it stands
for, and the byte range and the line and column range of that node’s printed
content characters. TextOutput::marks holds one per printed presentation
node, except a node printed over several lines of a table’s cell, which has
one mark per line of the cell on which it prints a character (see the
module documentation);
and TextOutput::slice returns the text it covers.
Two runs over the same document produce equal marks, because a lowered node is addressed by its position rather than by an identifier assigned during the run.
Fields§
§id: MarkIdThe layout engine’s identifier of the mark. The emitter assigns
identifiers in the order it builds the marked parts, so the mark of an
enclosing node has a larger identifier than the marks inside it; the
order of TextOutput::marks is the order in which the printer opens
the marks.
addr: LoweredAddrThe lowered node this mark stands for. Find the node in the backend’s
lowered-trees table with
LoweredAddr::resolve;
the address refers to no node of a frozen
tree.
bytes: Range<usize>The byte range of TextOutput::text that holds the node’s printed
content characters.
start: LineColThe line and column of the first content character printed for the node, counted from 0.
end: LineColThe line and column just after the last content character printed for the node.
Trait Implementations§
impl Eq for TextMark
impl StructuralPartialEq for TextMark
Auto Trait Implementations§
impl Forget for TextMark
impl Freeze for TextMark
impl Move for TextMark
impl RefUnwindSafe for TextMark
impl Send for TextMark
impl Sync for TextMark
impl Unpin for TextMark
impl UnsafeUnpin for TextMark
impl UnwindSafe for TextMark
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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