Skip to main content

GetIdent

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl GetIdent for Attribute

Source§

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

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

Source§

impl GetIdent for GenericParam

Source§

impl GetIdent for ImplItem

Source§

impl GetIdent for Item

Source§

impl GetIdent for TraitItem

Implementors§

Source§

impl GetIdent for Meta1

Source§

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