pub trait ItemLike: Spanned {
// Required methods
fn attrs(&self) -> Result<&[Attribute]>;
fn attrs_mut(&mut self) -> Result<&mut Vec<Attribute>>;
fn function_or_method(&self) -> Result<&dyn FunctionLike>;
fn constant(&self) -> Result<&dyn ConstLike>;
fn is_type(&self) -> bool;
fn is_macro(&self) -> bool;
}Expand description
Extension for syn::Item
Required Methods§
Sourcefn attrs(&self) -> Result<&[Attribute]>
fn attrs(&self) -> Result<&[Attribute]>
Returns reference of inner attrs if not verbatim; otherwise Err
Sourcefn attrs_mut(&mut self) -> Result<&mut Vec<Attribute>>
fn attrs_mut(&mut self) -> Result<&mut Vec<Attribute>>
Returns mutable reference of inner attrs if not verbatim; otherwise Err
Sourcefn function_or_method(&self) -> Result<&dyn FunctionLike>
fn function_or_method(&self) -> Result<&dyn FunctionLike>
Returns function-like trait object of Item::Fn, ImplItem::Method, or TraitItem::Method