pub struct AnnotationRule;Expand description
The implementation of the general rule RULE, the default
on every backend that has no rule of its own for an annotation.
It lowers an annotation, a node of an annotator’s command or a cut part
of one, to a flm.pres.span around inline content, or to a
flm.pres.block around the one block that a cut part holds where the cut
part is placed among blocks. The span or block has the role
HIGHLIGHT_ROLE or COMMENT_ROLE, according to the annotation’s
form, and the two kind tokens <command> and annotator-<n>:
flm.pres.span { role: flm.annotations.highlight, kinds: [phf, annotator-0] }
├ flm.pres.deco.margin
│ └ flm.pres.span { role: flm.annotations.initials, kinds: [phf, annotator-0] }
│ └ "PhF"
└ the passage, loweredA cut part of a cut annotation also carries the kind token
MARK_CONTINUES_KIND when it is not the
last cut part, and MARK_CONTINUED_KIND
when it is not the first, so that a stylesheet can open a comment’s
brackets on its first cut part and close them on its last; a node that
was not cut carries neither.
The margin decoration that holds the initials is the first node of the span’s or the block’s own content, so that the lowering driver moves it into the node’s attached slot and leaves its decoration mark at the start of the content, where the annotation starts. The rule stages it when the annotator has initials and the node is a first cut part: a node that was not cut, or a cut part whose record says it is the first. Every cut part carries the annotator’s kind tokens, so that an output shows every cut part alike.
When AnnotationsRenderOptions::hidden is true, it stages nothing of the
annotation’s own: a highlight lowers to its passage’s lowered nodes, and a
comment to nothing.
§Errors
LowerError when the node carries no AnnotationElement or no
argument group, and
any error from reading the render option or lowering the content.
Trait Implementations§
Source§impl Clone for AnnotationRule
impl Clone for AnnotationRule
impl Copy for AnnotationRule
Source§impl Debug for AnnotationRule
impl Debug for AnnotationRule
Source§impl Default for AnnotationRule
impl Default for AnnotationRule
Auto Trait Implementations§
impl Forget for AnnotationRule
impl Freeze for AnnotationRule
impl Move for AnnotationRule
impl RefUnwindSafe for AnnotationRule
impl Send for AnnotationRule
impl Sync for AnnotationRule
impl Unpin for AnnotationRule
impl UnsafeUnpin for AnnotationRule
impl UnwindSafe for AnnotationRule
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<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