Struct rustdoc::clean::ItemUnstable [-] [+] [src]

pub struct Item {
    pub source: Span,
    pub name: Option<String>,
    pub attrs: Vec<Attribute>,
    pub inner: ItemEnum,
    pub visibility: Option<Visibility>,
    pub def_id: DefId,
    pub stability: Option<Stability>,
}

Anything with a source location and set of attributes and, optionally, a name. That is, anything that can be documented. This doesn't correspond directly to the AST's concept of an item; it's a strict superset.

Fields

source

Stringified span

name

Not everything has a name. E.g., impls

attrs
inner
visibility
def_id
stability

Methods

impl Item

fn doc_list<'a>(&'a self) -> Option<&'a [Attribute]>

Finds the doc attribute as a List and returns the list of attributes nested inside.

fn doc_value<'a>(&'a self) -> Option<&'a str>

Finds the doc attribute as a NameValue and returns the corresponding value found.

fn is_hidden_from_doc(&self) -> bool

fn is_mod(&self) -> bool

fn is_trait(&self) -> bool

fn is_struct(&self) -> bool

fn is_enum(&self) -> bool

fn is_fn(&self) -> bool

Trait Implementations

Derived Implementations

impl Debug for Item

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Decodable for Item

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Item, __D>

impl Encodable for Item

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S>

impl Clone for Item

fn clone(&self) -> Item

fn clone_from(&mut self, source: &Self)