Enum rhai_autodocs::doc_item::DocItem
source · pub enum DocItem {
Function {
root_metadata: FunctionMetadata,
metadata: Vec<FunctionMetadata>,
name: String,
index: usize,
},
CustomType {
metadata: CustomTypesMetadata,
index: usize,
},
}
Expand description
Generic representation of documentation for a specific item. (a function, a custom type, etc.)
Variants§
Implementations§
source§impl DocItem
impl DocItem
pub fn new_function( metadata: &[FunctionMetadata], name: &str, namespace: &str, options: &Options ) -> Result<Option<Self>, AutodocsError>
pub fn new_custom_type( metadata: CustomTypesMetadata, namespace: &str, options: &Options ) -> Result<Option<Self>, AutodocsError>
pub fn index(&self) -> usize
pub fn name(&self) -> &str
sourcepub fn find_index(
name: &str,
namespace: &str,
doc_comments: &[String]
) -> Result<Option<usize>, AutodocsError>
pub fn find_index( name: &str, namespace: &str, doc_comments: &[String] ) -> Result<Option<usize>, AutodocsError>
Find the order index of the item by searching for the index pattern.
sourcepub fn format_comments(doc_comments: &[String]) -> String
pub fn format_comments(doc_comments: &[String]) -> String
Format the function doc comments to make them into readable markdown.
sourcepub fn remove_extra_tokens(dc: Vec<String>) -> Vec<String>
pub fn remove_extra_tokens(dc: Vec<String>) -> Vec<String>
Remove crate specific comments, like rhai-autodocs:index
.
sourcepub fn fmt_doc_comments(dc: String) -> String
pub fn fmt_doc_comments(dc: String) -> String
Remove doc comments identifiers.
sourcepub fn remove_test_code(doc_comments: &str) -> String
pub fn remove_test_code(doc_comments: &str) -> String
NOTE: mdbook handles this automatically, but other markdown processors might not. Remove lines of code that starts with the ‘#’ token, which are removed on rust docs automatically.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocItem
impl RefUnwindSafe for DocItem
impl Send for DocItem
impl Sync for DocItem
impl Unpin for DocItem
impl UnwindSafe for DocItem
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