mod struct_directive

module struct_directive

Implementation of the rust:struct directive

Macros

macro make_nodes

DRY macro to create the nodes for the directive’s layout.

Structs and Unions

struct StructDirective

Struct to hold details for documenting a struct or a union.

name: String

The full Rust path of the struct, used as the name of the directive.

ident: String

The identifier for the struct.

options: Vec<DirectiveOption>

The directive options to use.

content: Vec<String>

The docstring for the struct.

fields: Vec<VariableDirective>

The fields of the struct, named or unnamed.

self_impls: Vec<ImplDirective>

Items within impl blocks for the struct/union.

trait_impls: Vec<ImplDirective>

Trait impls for the struct/union.

Implementations

impl StructDirective

Variables

const DIRECTIVE_NAME: &'static str

Functions

fn add_impl(&mut self, mut impl_: ImplDirective)

Add the impl directive to the struct.

The parent and visibility of the impl directive are updated along with the ownership.

Args:
impl_:

The ImplDirective for the struct.

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

Change the parent module of the struct and its items.

fn directive_visibility(&self) -> &DirectiveVisibility

Return the visibility of this directive.

fn from_item(parent_path: &str, item: &ItemStruct) -> Directive

Create a struct directive for a struct.

fn from_union(parent_path: &str, item: &ItemUnion) -> Directive

Create a struct directive for a union.

fn from_variant(parent_path: &str, variant: &Variant, inherited_visibility: &Option<&Visibility>) -> StructDirective

Create a struct directive for an enum variant.

Traits implemented

impl RstDirective for StructDirective

Functions

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

Functions

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