pub struct NumberedValue<'a> { /* private fields */ }Expand description
One value that a number writer is asked to write: the counter value, the counters it is numbered within, the scoped instance it was counted in if any, and its position among the values the caller passed in.
The position is what the link mark of a written item carries: 0 for the
only value of format, and the position in the caller’s
list for format_many. The library sets it; a caller
builds a value with new and, where the counter is
numbered within others, within.
Implementations§
Source§impl<'a> NumberedValue<'a>
impl<'a> NumberedValue<'a>
Sourcepub fn new(value: &'a CounterValue) -> NumberedValue<'a>
pub fn new(value: &'a CounterValue) -> NumberedValue<'a>
Returns value, numbered within nothing and counted in no scoped
instance.
Sourcepub fn within(self, parent: Parent<'a>) -> NumberedValue<'a>
pub fn within(self, parent: Parent<'a>) -> NumberedValue<'a>
Builder: this value is numbered within parent, which holds the
within-joiner that writes the ancestors’ numbers and the ancestors
themselves.
Sourcepub fn in_instance(self, instance: NodeAddr) -> NumberedValue<'a>
pub fn in_instance(self, instance: NodeAddr) -> NumberedValue<'a>
Builder: this value was counted in the scoped instance attached to the
node instance (see
NumberSource::instances).
Values of two different instances belong to two different sequences of
the counter, so the default writer never groups them together,
regardless of their ancestors: the first items of two sibling lists
are 1 and 1, never a range.
Sourcepub fn instance(&self) -> Option<NodeAddr>
pub fn instance(&self) -> Option<NodeAddr>
Returns the scoped instance this value was counted in, or None for a
value of the counter’s single sequence through the document.
Sourcepub fn value(&self) -> &'a CounterValue
pub fn value(&self) -> &'a CounterValue
Returns the counter value itself.
Trait Implementations§
Source§impl<'a> Clone for NumberedValue<'a>
impl<'a> Clone for NumberedValue<'a>
impl<'a> Copy for NumberedValue<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for NumberedValue<'a>
impl<'a> !UnwindSafe for NumberedValue<'a>
impl<'a> Forget for NumberedValue<'a>
impl<'a> Freeze for NumberedValue<'a>
impl<'a> Move for NumberedValue<'a>
impl<'a> Send for NumberedValue<'a>
impl<'a> Sync for NumberedValue<'a>where
RawVecInner: Sync,
Arc<str>: Sync,
Arc<CounterStyle>: Sync,
Arc<dyn CompiledWithinJoiner>: Sync,
impl<'a> Unpin for NumberedValue<'a>
impl<'a> UnsafeUnpin for NumberedValue<'a>where
&'a CounterValue: UnsafeUnpin,
&'a dyn CompiledWithinJoiner: UnsafeUnpin,
&'a [Ancestor]: 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