mod enum_directive

module enum_directive

Implementation of the rust:enum directive

Structs and Unions

struct EnumDirective

Struct to hold data for documenting an enum

name: String

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

ident: String

The identifier for the enum.

options: Vec<DirectiveOption>

The directive options to use.

content: Vec<String>

The docstring for the enum.

variants: Vec<StructDirective>

The variants within the enum.

self_impls: Vec<ImplDirective>

Items within impl blocks for the enum.

trait_impls: Vec<ImplDirective>

Trait impls for the enum.

Implementations

impl EnumDirective

Variables

const DIRECTIVE_NAME: &'static str

Functions

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

Add the impl directive to the enum.

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

Args:
impl_:

The ImplDirective for the enum.

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

Change the parent module of the enum and its variants.

fn directive_visibility(&self) -> &DirectiveVisibility

Return the visibility of this directive.

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

Create a new Directive::Enum from a syn::ItemEnum

Args:
parent_path:

The full path of the module the enum is in.

item:

The syn::ItemEnum to parse.

Returns:

A new Directive::Enum, which contains the parsed EnumDirective in it.

Traits implemented

impl RstDirective for EnumDirective

Functions

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

Functions

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