pub struct DocRegistry { /* private fields */ }Expand description
holds every command doc and guide for the current program session.
Implementations§
Source§impl DocRegistry
impl DocRegistry
Sourcepub fn register_command<K: Into<String>>(&mut self, key: K, doc: CommandDoc)
pub fn register_command<K: Into<String>>(&mut self, key: K, doc: CommandDoc)
attach metadata to a command path (dot-separated, "" for the main program).
Sourcepub fn register_guide<K, C>(&mut self, key: K, content: C)
pub fn register_guide<K, C>(&mut self, key: K, content: C)
add a free-form markdown guide that can be opened via guide <path>.
Sourcepub fn command(&self, key: &str) -> Option<&CommandDoc>
pub fn command(&self, key: &str) -> Option<&CommandDoc>
fetch docs for a command, if any.
Trait Implementations§
Source§impl Default for DocRegistry
impl Default for DocRegistry
Source§fn default() -> DocRegistry
fn default() -> DocRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DocRegistry
impl RefUnwindSafe for DocRegistry
impl Send for DocRegistry
impl Sync for DocRegistry
impl Unpin for DocRegistry
impl UnwindSafe for DocRegistry
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