mod trait_directive

module trait_directive

Implementation of the rust:trait directive

Structs and Unions

struct TraitDirective

Struct to hold details for documenting a trait.

name: String

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

ident: String

The identifier for the trait.

options: Vec<DirectiveOption>

The directive options to use.

content: Vec<String>

The docstring for the trait.

items: Vec<Directive>

Items within the trait.

impls: Vec<ImplDirective>

Generic impls of the trait.

Implementations

impl TraitDirective

Variables

const DIRECTIVE_NAME: &'static str

Functions

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

Add the impl directive to the trait.

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

Args:
impl_:

The ImplDirective for the trait.

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

Change the parent module of the trait and its items.

fn directive_visibility(&self) -> &DirectiveVisibility

Return the visibility of this directive.

fn from_alias(parent_path: &str, alias: &ItemTraitAlias) -> Directive

Create a trait directive from a trait alias.

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

Create a trait directive from the trait definition.

Traits implemented

impl RstDirective for TraitDirective

Functions

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

Functions

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