syn_ext::ext

Trait GetIdent

Source
pub trait GetIdent {
    // Required method
    fn get_ident(&self) -> Option<&Ident>;
}
Expand description

Shortcut to get syn::Ident from various types

Required Methods§

Source

fn get_ident(&self) -> Option<&Ident>

Returns reference of ident if its syn::Path is syn::Ident; Otherwise None

Any crate::ext::GetPath also implements GetIdent.

Implementations on Foreign Types§

Source§

impl GetIdent for Meta

Source§

fn get_ident(&self) -> Option<&Ident>

Get ident of syn::Meta::path

Source§

impl GetIdent for GenericParam

Source§

impl GetIdent for ImplItem

Source§

impl GetIdent for Item

Source§

impl GetIdent for TraitItem

Source§

impl GetIdent for Attribute

Source§

fn get_ident(&self) -> Option<&Ident>

Get ident of the syn::Attribute::path field.

Implementors§

Source§

impl<T> GetIdent for T
where T: GetPath,