Struct user_doc_doc_data::DocDict
source · pub struct DocDict(pub DocDictTree, pub Vec<(Vec<usize>, String)>);Expand description
A (possibly-nested) dictionary of docs
Tuple Fields§
§0: DocDictTreeThe dictionary tree
1: Vec<(Vec<usize>, String)>Backlinks and blurbs
Implementations§
source§impl DocDict
impl DocDict
sourcepub fn add_entry(
&mut self,
documentable: Documentable,
name_opt: Option<String>,
number_opt: Option<usize>,
overwrite_opt: Option<bool>
) -> Result<()>
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
sourcepub 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<()>
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_optcontainstrue
sourcepub fn deep_iter(
&self,
start_slug_opt: Option<Vec<usize>>
) -> IntoIter<(Vec<usize>, &DocDictEntryValueType, usize)>
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.
sourcepub fn expand_into_mdbook_dirs_at_path(
&self,
naming_scheme: DirectoryNamingScheme,
root_path: &str
) -> Result<()>
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
sourcepub fn find_next_entry_number(&self) -> usize
pub fn find_next_entry_number(&self) -> usize
Find the next available (unused) entry number in a documentation dictionary
sourcepub fn get_entry_at_numeric_path(
&self,
path: &[usize]
) -> Option<&DocDictEntryValueType>
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.
sourcepub fn get_mut_entry_at_numeric_path(
&mut self,
path: &[usize]
) -> Option<&mut DocDictEntryValueType>
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<'de> Deserialize<'de> for DocDict
impl<'de> Deserialize<'de> for DocDict
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
source§impl Ord for DocDict
impl Ord for DocDict
source§impl PartialEq<DocDict> for DocDict
impl PartialEq<DocDict> for DocDict
source§impl PartialOrd<DocDict> for DocDict
impl PartialOrd<DocDict> for DocDict
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl Eq for DocDict
impl StructuralEq for DocDict
impl StructuralPartialEq for DocDict
Auto Trait Implementations§
impl RefUnwindSafe for DocDict
impl Send for DocDict
impl Sync for DocDict
impl Unpin for DocDict
impl UnwindSafe for DocDict
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
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,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.