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§
Sourcefn is_path(&self) -> bool
fn is_path(&self) -> bool
Returns true if self matches syn::Meta::Path
Sourcefn is_list(&self) -> bool
fn is_list(&self) -> bool
Returns true if self matches syn::Meta::List
Sourcefn is_name_value(&self) -> bool
fn is_name_value(&self) -> bool
Returns true if self matches syn::Meta::NameValue
Sourcefn promote_to_list(&mut self, paren: Paren) -> Result<&mut MetaList1>
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.
Sourcefn list(&self) -> Result<&MetaList1>
fn list(&self) -> Result<&MetaList1>
Returns syn::MetaList of syn::Meta::List; Otherwise Err
Sourcefn list_mut(&mut self) -> Result<&mut MetaList1>
fn list_mut(&mut self) -> Result<&mut MetaList1>
Returns syn::MetaList of syn::Meta::List; Otherwise Err
Sourcefn name_value(&self) -> Result<&MetaNameValue>
fn name_value(&self) -> Result<&MetaNameValue>
Returns syn::MetaNameValue of syn::Meta::NameValue; Otherwise Err
Sourcefn name_value_mut(&mut self) -> Result<&mut MetaNameValue>
fn name_value_mut(&mut self) -> Result<&mut MetaNameValue>
Returns syn::MetaNameValue of syn::Meta::NameValue; Otherwise Err