pub struct TocConfig {
pub title: Option<String>,
pub levels: Option<Vec<u32>>,
pub page_numbers: Option<bool>,
pub leaders: Option<TocLeaders>,
}Expand description
Table of contents configuration.
Fields§
§title: Option<String>Custom title for the table of contents.
levels: Option<Vec<u32>>Which heading levels to include (e.g., [1, 2, 3]).
page_numbers: Option<bool>Whether to show page numbers.
leaders: Option<TocLeaders>Leader style between title and page number.
Implementations§
Source§impl TocConfig
impl TocConfig
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the TOC title.
Sourcepub fn with_levels(self, levels: Vec<u32>) -> Self
pub fn with_levels(self, levels: Vec<u32>) -> Self
Set which heading levels to include.
Sourcepub const fn with_page_numbers(self) -> Self
pub const fn with_page_numbers(self) -> Self
Enable page numbers.
Sourcepub const fn with_leaders(self, leaders: TocLeaders) -> Self
pub const fn with_leaders(self, leaders: TocLeaders) -> Self
Set the leader style.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TocConfig
impl<'de> Deserialize<'de> for TocConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TocConfig
impl StructuralPartialEq for TocConfig
Auto Trait Implementations§
impl Freeze for TocConfig
impl RefUnwindSafe for TocConfig
impl Send for TocConfig
impl Sync for TocConfig
impl Unpin for TocConfig
impl UnsafeUnpin for TocConfig
impl UnwindSafe for TocConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.