pub struct AnnotationElement {
pub annotator: Annotator,
pub number: usize,
}Expand description
The data that each element value of ANNOTATION carries: the annotator
whose command writes the annotation, and the annotator’s number, its
position in the configuration counted from zero.
The element value also carries three aspects, each implemented on this
type: the block role (BlockRoleAspect) and the cut into cut parts
(BlockTransparent), described at AnnotationPiece, and the content
apart from the text (ApartFromText).
Fields§
§annotator: AnnotatorThe annotator.
number: usizeThe annotator’s number.
Trait Implementations§
Source§impl ApartFromText for AnnotationElement
A comment is not part of the text around it: its remark, the argument
TEXT_ARG, is the annotator’s. The plain text of a heading’s title that
holds a comment therefore leaves the remark out, and so does the
identifier made from that text. A highlight’s passage is part of the
text, so a highlight returns no content reference.
impl ApartFromText for AnnotationElement
A comment is not part of the text around it: its remark, the argument
TEXT_ARG, is the annotator’s. The plain text of a heading’s title that
holds a comment therefore leaves the remark out, and so does the
identifier made from that text. A highlight’s passage is part of the
text, so a highlight returns no content reference.
Source§fn apart_from_text(&self, node: &NodeRef<'_, Flm>) -> Vec<ContentRef>
fn apart_from_text(&self, node: &NodeRef<'_, Flm>) -> Vec<ContentRef>
node.Source§impl BlockRoleAspect for AnnotationElement
An annotation is inline content where its argument is laid out as inline
content, and a block where its argument is laid out as blocks: after the
cut, that is a cut part around one block. Before the cut, an annotation
holding a paragraph break is also a block, so that an annotation around
it treats it as a place to cut.
impl BlockRoleAspect for AnnotationElement
An annotation is inline content where its argument is laid out as inline content, and a block where its argument is laid out as blocks: after the cut, that is a cut part around one block. Before the cut, an annotation holding a paragraph break is also a block, so that an annotation around it treats it as a place to cut.
Source§impl BlockTransparent for AnnotationElement
The cut of an annotation. An annotation is left unchanged when its
argument holds no paragraph break and no block, or when it is already a
cut part. Otherwise it is cut into one cut part around each stretch of
inline content and one around each block, with the paragraph-break markers
passed through between them. A stretch of whitespace and source comments
alone makes no cut part, so an annotation holding nothing but a paragraph
break (\phf{, a blank line, }) is cut into no cut part and leaves
nothing of itself, while \phf{}, which is not cut, is an annotation of
empty content.
impl BlockTransparent for AnnotationElement
The cut of an annotation. An annotation is left unchanged when its
argument holds no paragraph break and no block, or when it is already a
cut part. Otherwise it is cut into one cut part around each stretch of
inline content and one around each block, with the paragraph-break markers
passed through between them. A stretch of whitespace and source comments
alone makes no cut part, so an annotation holding nothing but a paragraph
break (\phf{, a blank line, }) is cut into no cut part and leaves
nothing of itself, while \phf{}, which is not cut, is an annotation of
empty content.
Source§fn cut(
&self,
node: NodeRef<'_, Flm>,
cx: &mut StructureCx<'_>,
cutter: &mut dyn BlockCutter,
) -> Result<Cutting, StructureError>
fn cut( &self, node: NodeRef<'_, Flm>, cx: &mut StructureCx<'_>, cutter: &mut dyn BlockCutter, ) -> Result<Cutting, StructureError>
node into cut parts, or leaves it as it is. Read moreSource§impl Clone for AnnotationElement
impl Clone for AnnotationElement
Source§impl Debug for AnnotationElement
impl Debug for AnnotationElement
impl Eq for AnnotationElement
Source§impl PartialEq for AnnotationElement
impl PartialEq for AnnotationElement
impl StructuralPartialEq for AnnotationElement
Auto Trait Implementations§
impl Forget for AnnotationElement
impl Freeze for AnnotationElement
impl Move for AnnotationElement
impl RefUnwindSafe for AnnotationElement
impl Send for AnnotationElement
impl Sync for AnnotationElement
impl Unpin for AnnotationElement
impl UnsafeUnpin for AnnotationElement
impl UnwindSafe for AnnotationElement
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