pub struct DocDict(pub DocDictTree, pub Vec<(Vec<usize>, String)>);
Expand description

A (possibly-nested) dictionary of docs

Tuple Fields§

§0: DocDictTree

The dictionary tree

§1: Vec<(Vec<usize>, String)>

Backlinks and blurbs

Implementations§

source§

impl DocDict

source

pub fn add_entry( &mut self, documentable: Documentable, name_opt: Option<String>, number_opt: Option<usize>, overwrite_opt: Option<bool> ) -> Result<()>

Add an entry to a documentation dictionary

source

pub fn add_path( &mut self, chapter_blurb_opt: &Option<String>, name_opt: &Option<String>, documentable_opt: Option<Documentable>, overwrite_opt: Option<bool>, path_names: &[String], path_numbers: &[usize] ) -> Result<()>

Add the path specified to a documentation dictionary, filling with empty subtrees to get there. Return Ok(()) on success.

  • If the path exists, fail unless overwrite_opt contains true
source

pub fn deep_iter( &self, start_slug_opt: Option<Vec<usize>> ) -> IntoIter<(Vec<usize>, &DocDictEntryValueType, usize)>

Produce a depth-first, immutable iterator over the entries.

  • The iterator item includes a slug of chapters, the current entry node, and the number of sub entries for the current node The iterator will produce entries for the chapters AS WELL AS entries for the subchapters of those chapters.
source

pub fn expand_into_mdbook_dirs_at_path( &self, naming_scheme: DirectoryNamingScheme, root_path: &str ) -> Result<()>

Expand this doc dict into directories at the given directory path

source

pub fn find_next_entry_number(&self) -> usize

Find the next available (unused) entry number in a documentation dictionary

source

pub fn get_entry_at_numeric_path( &self, path: &[usize] ) -> Option<&DocDictEntryValueType>

Get an immutable reference to an entry at the specified numeric path. Returns None if the a path is not present.

source

pub fn get_mut_entry_at_numeric_path( &mut self, path: &[usize] ) -> Option<&mut DocDictEntryValueType>

Get a mutable reference to an entry at the specified numeric path. Returns None if the a path is not present.

Trait Implementations§

source§

impl Clone for DocDict

source§

fn clone(&self) -> DocDict

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DocDict

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DocDict

source§

fn default() -> DocDict

Returns the “default value” for a type. Read more
source§

impl Deref for DocDict

§

type Target = BTreeMap<usize, (String, Documentable), Global>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for DocDict

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for DocDict

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Ord for DocDict

source§

fn cmp(&self, other: &DocDict) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<DocDict> for DocDict

source§

fn eq(&self, other: &DocDict) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<DocDict> for DocDict

source§

fn partial_cmp(&self, other: &DocDict) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for DocDict

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for DocDict

source§

impl StructuralEq for DocDict

source§

impl StructuralPartialEq for DocDict

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,