pub struct CounterOptions {
pub within: Option<WithinOption>,
pub initial: Option<u32>,
}Expand description
What a document’s numbering options say about one counter: the counter
within which it is numbered, and the value it has before it is first
advanced. A field left None keeps what the counter was declared with.
Fields§
§within: Option<WithinOption>The counter’s place in the hierarchy of counters. None keeps the
place its declaration gives.
initial: Option<u32>The value the counter has before it is first advanced, or None for a
counter that has no value until then.
A counter with no value cannot be written, so a reference point
numbered within it takes no number and is reported as the Error
flm.numbering.parent-uninitialized. Some(0) gives the counter the
value 0, so that a subsection written before any section is numbered
0.1. The counter is then advanced from that value: Some(3) makes
the first section 4. The value applies under every combination of
the values of the counter’s ancestors: an initial 0 for
flm.headings.subsection makes a subsubsection written in a section
that has no subsection yet read as though the subsection had the value
0, 1.0.1. When the parent that applies is chosen among several, the
counters with initial values count as advanced before the document
begins, the outermost counter first.
Implementations§
Source§impl CounterOptions
impl CounterOptions
Sourcepub fn new() -> CounterOptions
pub fn new() -> CounterOptions
Returns options that change nothing.
Sourcepub fn within(self, within: Within) -> CounterOptions
pub fn within(self, within: Within) -> CounterOptions
Builder: numbers the counter within the counters within gives, in
place of what it was declared with.
The counters that within gives must be declared by some feature; a
counter in within that no feature declares is reported as a Warning
and the option changes nothing. The reports and their effects are
listed under NumberingOptions.
Sourcepub fn within_nothing(self) -> CounterOptions
pub fn within_nothing(self) -> CounterOptions
Builder: numbers the counter within nothing, so that it is never restarted and no other counter’s number is written before its own.
Sourcepub fn initial(self, value: u32) -> CounterOptions
pub fn initial(self, value: u32) -> CounterOptions
Builder: gives the counter the value value before it is first
advanced (see initial).
Trait Implementations§
Source§impl Clone for CounterOptions
impl Clone for CounterOptions
Source§impl Debug for CounterOptions
impl Debug for CounterOptions
Source§impl Default for CounterOptions
impl Default for CounterOptions
Source§impl<'de> Deserialize<'de> for CounterOptionswhere
CounterOptions: Default,
impl<'de> Deserialize<'de> for CounterOptionswhere
CounterOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CounterOptions
Source§impl Hash for CounterOptions
impl Hash for CounterOptions
Source§impl JsonSchema for CounterOptions
impl JsonSchema for CounterOptions
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CounterOptions
impl PartialEq for CounterOptions
impl StructuralPartialEq for CounterOptions
Auto Trait Implementations§
impl Forget for CounterOptions
impl Freeze for CounterOptions
impl Move for CounterOptions
impl RefUnwindSafe for CounterOptions
impl Send for CounterOptions
impl Sync for CounterOptions
impl Unpin for CounterOptions
impl UnsafeUnpin for CounterOptions
impl UnwindSafe for CounterOptions
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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