pub struct Ancestor {
pub counter: Name,
pub value: CounterValue,
pub style: Arc<CounterStyle>,
pub joiner: Option<Arc<dyn CompiledWithinJoiner>>,
pub instance: Option<NodeAddr>,
}Expand description
An ancestor: one counter within which a number is numbered, as the numbering feature records it: the counter’s name, its value at the numbered point, the counter style in which that value is written, and the within-joiner that writes that counter’s own ancestors before it.
Because each ancestor carries its own within-joiner, a chain of counters is
written one step at a time: a within-joiner that refers to
flm.headings.subsection writes the
subsection’s number preceded by what the subsection’s own within-joiner
writes, 2.3., so a within-joiner refers only to the counter immediately
above.
An ancestor counted in a scoped instance also records which instance, for
example the enclosing list of an item of a nested list
(instance).
Fields§
§counter: NameThe counter’s name.
value: CounterValueIts value at the numbered point.
style: Arc<CounterStyle>The counter style in which its value is written.
joiner: Option<Arc<dyn CompiledWithinJoiner>>The within-joiner that writes this counter’s own ancestors before its
number, or None for a counter numbered within nothing. Those
ancestors are the ones before it in the list a Parent carries.
instance: Option<NodeAddr>The scoped instance this value was counted in, as the address of the
node the instance is attached to, or None for a value of the
counter’s single sequence through the document. See
NumberSource::instances.
Implementations§
Source§impl Ancestor
impl Ancestor
Sourcepub fn new(
counter: impl Into<Name>,
value: CounterValue,
style: Arc<CounterStyle>,
) -> Ancestor
pub fn new( counter: impl Into<Name>, value: CounterValue, style: Arc<CounterStyle>, ) -> Ancestor
Returns an ancestor numbered within nothing and counted in no scoped
instance. Its own within-joiner, if it has one, is added with
within.
Sourcepub fn in_instance(self, instance: NodeAddr) -> Ancestor
pub fn in_instance(self, instance: NodeAddr) -> Ancestor
Returns this ancestor as a value counted in the scoped instance
attached to the node instance.
Sourcepub fn within(self, joiner: Arc<dyn CompiledWithinJoiner>) -> Ancestor
pub fn within(self, joiner: Arc<dyn CompiledWithinJoiner>) -> Ancestor
Returns this ancestor with joiner as the within-joiner that writes
its own ancestors’ numbers before its own.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Ancestor
impl !UnwindSafe for Ancestor
impl Forget for Ancestor
impl Freeze for Ancestor
impl Move for Ancestor
impl Send for Ancestor
impl Sync for Ancestor
impl Unpin for Ancestor
impl UnsafeUnpin for Ancestor
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