pub struct AnnotationPiece {
pub cut: usize,
pub index: usize,
pub count: usize,
}Expand description
The continuation record a cut part of an annotation carries: which cut made it, its rank among the cut parts of that cut, and how many cut parts the cut made.
The block-structure pass cuts an annotation whose passage or remark
crosses a paragraph break or holds a block into cut parts: one node of the
annotation’s element around each stretch of inline content, and one
around each block (the feature’s documentation). Each cut part
carries this record as its payload
(FlmNodeExt::payload); read it with
payload_of::<AnnotationPiece>(&node). An annotation that was not cut
carries no record, and the lowering rules treat it as both the first and
the last cut part.
The cut part with index == 0 is the first: only it shows the initials.
The cut part with index + 1 == count is the last. The record is plain
data, serialized as {cut, index, count} and read back from that form by
the reader that payload_readers registers under the element’s name,
so that a frozen tree holding cut parts can be read back from its
serialized form.
Fields§
§cut: usizeThe cut’s number, unique within the tree, in the order in which the block-structure pass reaches the annotations: an annotation before those inside it.
index: usizeThe cut part’s rank among the cut parts of its cut, from zero.
count: usizeHow many cut parts the cut made.
Implementations§
Source§impl AnnotationPiece
impl AnnotationPiece
Sourcepub fn from_projection(
value: &SerialValue,
) -> Result<AnnotationPiece, DeserializeError>
pub fn from_projection( value: &SerialValue, ) -> Result<AnnotationPiece, DeserializeError>
Rebuilds the record from its serialized form, {cut, index, count}.
§Errors
A DeserializeError that identifies the element when the value is
not a map holding the three fields as non-negative integers.
Trait Implementations§
Source§impl Clone for AnnotationPiece
impl Clone for AnnotationPiece
impl Copy for AnnotationPiece
Source§impl Debug for AnnotationPiece
impl Debug for AnnotationPiece
impl Eq for AnnotationPiece
Source§impl Hash for AnnotationPiece
impl Hash for AnnotationPiece
Source§impl PartialEq for AnnotationPiece
impl PartialEq for AnnotationPiece
Source§impl PresPayload for AnnotationPiece
impl PresPayload for AnnotationPiece
Source§fn project(&self) -> SerialValue
fn project(&self) -> SerialValue
impl StructuralPartialEq for AnnotationPiece
Auto Trait Implementations§
impl Forget for AnnotationPiece
impl Freeze for AnnotationPiece
impl Move for AnnotationPiece
impl RefUnwindSafe for AnnotationPiece
impl Send for AnnotationPiece
impl Sync for AnnotationPiece
impl Unpin for AnnotationPiece
impl UnsafeUnpin for AnnotationPiece
impl UnwindSafe for AnnotationPiece
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