mod function_directive
- module function_directive
Implementation of the
rust:functiondirectiveMacros
- macro func_from_item
DRY macro to parse the different item types.
Functions
- fn nodes_for_fn_signature(signature: &Signature) -> Vec<Node>
Generate docutils node layout for the function from its signature
Structs and Unions
- struct FunctionDirective
Struct to hold data for documenting a function.
- name: String
The full Rust path of the function.
- ident: String
The identifier of the function.
- options: Vec<DirectiveOption>
The directive options to use.
- content: Vec<String>
The docstring for the function.
Implementations
- impl FunctionDirective
Variables
- const DIRECTIVE_NAME: &'static str
Functions
- fn change_parent(&mut self, new_parent: &str)
Change the parent directive of the function.
- fn directive_visibility(&self) -> &DirectiveVisibility
Return the visibility of this directive.
- fn from_extern(parent_path: &str, item: &ForeignItemFn) -> Directive
Create a new
Directive::Functionfrom asyn::ForeignItemFn.- Args:
- parent_path:
The full path of the trait the function is in.
- item:
The
syn::ForeignItemFnreference to parse.- inherited_visibility:
The visibility of the parent module.
- Returns:
A new
Directive::Functionvalue, which contains the parsedFunctionDirectivein it.
- fn from_impl_item(parent_path: &str, item: &ImplItemFn, inherited_visibility: &Option<&Visibility>) -> Directive
Create a new
Directive::Functionfrom asyn::ImplItemFn.- Args:
- parent_path:
The full path of the impl block the function is in.
- item:
The
syn::ImplItemFnreference to parse.- inherited_visibility:
The visibility of the impl block.
- Returns:
A new
Directive::Functionvalue, which contains the parsedFunctionDirectivein it.
- fn from_item(parent_path: &str, item: &ItemFn) -> Directive
Create a new
Directive::Functionfrom asyn::ItemFn.- Args:
- parent_path:
The full path of the module the function is in.
- item:
The
syn::ItemFnreference to parse.- inherited_visibility:
The visibility of the parent module.
- Returns:
A new
Directive::Functionvalue, which contains the parsedFunctionDirectivein it.
- fn from_trait_item(parent_path: &str, item: &TraitItemFn, inherited_visibility: &Option<&Visibility>) -> Directive
Create a new
Directive::Functionfrom asyn::TraitItemFn.- Args:
- parent_path:
The full path of the trait the function is in.
- item:
The
syn::TraitItemFnreference to parse.- inherited_visibility:
The visibility of the trait.
- Returns:
A new
Directive::Functionvalue, which contains the parsedFunctionDirectivein it.
Traits implemented
- impl RstDirective for FunctionDirective
Functions
- fn get_rst_text(self, level: usize, max_visibility: &DirectiveVisibility) -> Vec<String>
- impl MdDirective for FunctionDirective
Functions
- fn get_md_text(self, fence_size: usize, max_visibility: &DirectiveVisibility) -> Vec<String>