mod variable_directive

module variable_directive

Implementation of the rust:variable directive

Macros

macro var_from_item

DRY macro to create VariableDirective from various syn structs.

Structs and Unions

struct VariableDirective

Struct to hold the data for documenting variables and struct fields.

name: String

The Rust path of the variable or field.

ident: String

The identifier of the variable or field.

options: Vec<DirectiveOption>

The options for the directive.

content: Vec<String>

The content of the directive.

Implementations

impl VariableDirective

Variables

const DIRECTIVE_NAME: &'static str

Functions

fn change_parent(&mut self, new_parent: &str)

Change the parent directive of the variable.

fn directive_visibility(&self) -> &DirectiveVisibility

Return the visibility of this directive.

fn from_const(parent_path: &str, item: &ItemConst) -> Directive

Create a variable directive for a const variable.

fn from_extern_static(parent_path: &str, item: &ForeignItemStatic) -> Directive

Create a variable directive for a foreign static variable.

fn from_fields(parent_path: &str, fields: &Fields, inherited_visibility: &Option<&Visibility>, index_entry_type: IndexEntryType) -> Vec<Self>

Create variable directives from the fields of a struct or enum variant.

fn from_impl_const(parent_path: &str, item: &ImplItemConst, inherited_visibility: &Option<&Visibility>) -> Directive

Create a variable directive for a const variable within an impl block.

fn from_static(parent_path: &str, item: &ItemStatic) -> Directive

Create a variable directive for a static variable.

fn from_trait_const(parent_path: &str, item: &TraitItemConst, inherited_visibility: &Option<&Visibility>) -> Directive

Create a variable directive for a const variable within a trait definition.

Traits implemented

impl RstDirective for VariableDirective

Functions

fn get_rst_text(self, level: usize, max_visibility: &DirectiveVisibility) -> Vec<String>
impl MdDirective for VariableDirective

Functions

fn get_md_text(self, fence_size: usize, max_visibility: &DirectiveVisibility) -> Vec<String>