pub struct FootnoteDef {
pub label: String,
pub offset: Option<usize>,
}Expand description
A footnote definition and the reference that sends a reader to it — the
answer to Doc::footnote_definition_at, and the other half of the round
trip FootnoteRef starts.
A note is a place a reader arrives, so the useful thing to know while standing in one is the way back. Without this the jump to a note is a one-way door: the definitions sit at the foot of the document, so returning by hand means scrolling back up and finding the sentence again.
Fields§
§label: StringThe definition’s label — the 1 of [^1]: …, marker and colon stripped,
spelled exactly as FootnoteRef::label spells the same footnote’s.
offset: Option<usize>Where the reference’s label is, for a “back to reference” that moves
the caret there. None for a note nothing refers to — an orphan, which
is worth being able to say rather than silently doing nothing.
The label rather than the reference’s first byte, for
FootnoteRef::offset’s reason: a reference’s brackets are decoration
and its label is the only part of it the caret can rest on.
The first reference, when a label is cited more than once: a repeated citation has no one true home, and the first is both the one a reader most likely came from and the only choice that doesn’t depend on how they got here.
Trait Implementations§
Source§impl Clone for FootnoteDef
impl Clone for FootnoteDef
Source§fn clone(&self) -> FootnoteDef
fn clone(&self) -> FootnoteDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more