MetaExt

Trait MetaExt 

Source
pub trait MetaExt {
    // Required methods
    fn is_path(&self) -> bool;
    fn is_list(&self) -> bool;
    fn is_name_value(&self) -> bool;
    fn is_doc(&self) -> bool;
    fn promote_to_list(&mut self, paren: Paren) -> Result<&mut MetaList1>;
    fn list(&self) -> Result<&MetaList1>;
    fn list_mut(&mut self) -> Result<&mut MetaList1>;
    fn name_value(&self) -> Result<&MetaNameValue>;
    fn name_value_mut(&mut self) -> Result<&mut MetaNameValue>;
    fn doc(&self) -> Result<String>;
}
Expand description

Extension for syn::Meta

Required Methods§

Source

fn is_path(&self) -> bool

Returns true if self matches syn::Meta::Path

Source

fn is_list(&self) -> bool

Returns true if self matches syn::Meta::List

Source

fn is_name_value(&self) -> bool

Returns true if self matches syn::Meta::NameValue

Source

fn is_doc(&self) -> bool

Returns true if the content matches doc = <string lit>

Source

fn promote_to_list(&mut self, paren: Paren) -> Result<&mut MetaList1>

Promotes to empty syn::Meta::List with given paren if syn::Meta::Path

A syn::Meta::Path value can be regarded as an empty syn::Meta::List. promote means converting syn::Meta::Path to an actual empty syn::Meta::List.

Source

fn list(&self) -> Result<&MetaList1>

Returns syn::MetaList of syn::Meta::List; Otherwise Err

Source

fn list_mut(&mut self) -> Result<&mut MetaList1>

Returns syn::MetaList of syn::Meta::List; Otherwise Err

Source

fn name_value(&self) -> Result<&MetaNameValue>

Returns syn::MetaNameValue of syn::Meta::NameValue; Otherwise Err

Source

fn name_value_mut(&mut self) -> Result<&mut MetaNameValue>

Returns syn::MetaNameValue of syn::Meta::NameValue; Otherwise Err

Source

fn doc(&self) -> Result<String>

Returns content of doc = <content>

Implementors§