pub struct CounterRecord {
pub counter: Name,
pub value: CounterValue,
pub ancestors: Vec<Ancestor>,
pub style: Arc<CounterStyle>,
pub instance: Option<NodeAddr>,
}Expand description
What the numbering stage recorded for one numbered reference point: the counter the point counts in, that counter’s value at the point, the counters it is numbered within with their own values, and the counter style in which its number is shown.
The record holds no text. Everything a reader sees is built from it when it is shown, so the same record serves every backend and every reference to the point.
The ancestors are the whole chain, outermost first, in the order
Parent requires: the ancestors of ancestors[i] are ancestors[..i].
For a counter with several possible parents, the chain is the one that
applied at the point: the parent advanced most recently, preceded by its
own ancestors.
A point counted in a scoped instance of its counter (an independent
sequence of the counter’s values attached to an enclosing node, such as a
list environment) records that instance
(instance). Where the instance is nested in
another instance of the same counter, the record’s last ancestor is the
enclosing instance’s value at the point, which records its own instance,
and the number is written with the counter’s nesting joiner
(CounterDecl::nesting) instead of the
counter’s within-joiner; the ancestors before it are the enclosing
instance’s own, down to the counters within which the outermost instance
is numbered. A record is nested exactly when its last ancestor is of its
own counter, since no counter is otherwise numbered within itself.
Fields§
§counter: NameThe counter the point counts in.
value: CounterValueThe counter’s value at the point.
ancestors: Vec<Ancestor>The counters this one is numbered within, outermost first, each with its value at the point, the counter style it is written in and its own within-joiner.
style: Arc<CounterStyle>The counter style in which the point’s own number is shown: the
counter style its number source gives, or, for a point that carries a
number template of its own, that counter style with its number format
replaced by the template
(CounterStyle::with_number_format).
instance: Option<NodeAddr>The scoped instance the point was counted in, as the address of the
node that instance is attached to (the last of the point’s
instances), or None
for a point counted in the counter’s single sequence through the
document.
Implementations§
Trait Implementations§
Source§impl Clone for CounterRecord
impl Clone for CounterRecord
Auto Trait Implementations§
impl !RefUnwindSafe for CounterRecord
impl !UnwindSafe for CounterRecord
impl Forget for CounterRecord
impl Freeze for CounterRecordwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<i64>: Freeze,
PhantomData<Ancestor>: Freeze,
*const ArcInner<CounterStyle> is !null: Freeze,
PhantomData<ArcInner<CounterStyle>>: Freeze,
impl Move for CounterRecord
impl Send for CounterRecordwhere
Arc<str>: Send,
RawVecInner: Send,
Arc<CounterStyle>: Send,
Arc<dyn CompiledWithinJoiner>: Send,
impl Sync for CounterRecordwhere
Arc<str>: Sync,
RawVecInner: Sync,
Arc<CounterStyle>: Sync,
Arc<dyn CompiledWithinJoiner>: Sync,
impl Unpin for CounterRecord
impl UnsafeUnpin for CounterRecordwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<i64>: UnsafeUnpin,
PhantomData<Ancestor>: UnsafeUnpin,
*const ArcInner<CounterStyle> is !null: UnsafeUnpin,
PhantomData<ArcInner<CounterStyle>>: UnsafeUnpin,
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