pub struct FootnoteRenderParams<'a> {
pub index: Option<&'a str>,
pub id: Option<&'a str>,
pub is_reference: bool,
pub text: &'a str,
}Expand description
Provides parameters for rendering the inline marker of a footnote macro.
There are three cases the renderer must distinguish:
- A defining occurrence (
indexisSome,is_referenceisfalse): the footnote introduces new text. The marker carries the footnote number and, when the footnote was given an ID, anidof its own. - A reference to an earlier footnote (
indexisSome,is_referenceistrue): a later occurrence (footnote:id[]) that reuses an existing footnote’s number. - An unresolved reference (
indexisNone,is_referenceistrue): a reference whose ID was never defined; the renderer emits a visible error marker built fromtext.
Fields§
§index: Option<&'a str>The footnote’s number, or None for an unresolved reference. Normally a
consecutive integer, but the footnote-number counter honors any seed
the document sets, so it is passed through as text.
id: Option<&'a str>The footnote’s own ID, used only on a defining occurrence to produce the
id="_footnote_<id>" attribute on the marker.
is_reference: booltrue when this occurrence references an existing footnote (or fails to
resolve one); false for the defining occurrence.
text: &'a strFor an unresolved reference, the text to show inside the error marker (the unresolved ID). Ignored in the other cases.
Trait Implementations§
Source§impl<'a> Clone for FootnoteRenderParams<'a>
impl<'a> Clone for FootnoteRenderParams<'a>
Source§fn clone(&self) -> FootnoteRenderParams<'a>
fn clone(&self) -> FootnoteRenderParams<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for FootnoteRenderParams<'a>
impl<'a> RefUnwindSafe for FootnoteRenderParams<'a>
impl<'a> Send for FootnoteRenderParams<'a>
impl<'a> Sync for FootnoteRenderParams<'a>
impl<'a> Unpin for FootnoteRenderParams<'a>
impl<'a> UnsafeUnpin for FootnoteRenderParams<'a>
impl<'a> UnwindSafe for FootnoteRenderParams<'a>
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
Mutably borrows from an owned value. Read more