Trait FieldInfo

Source
pub trait FieldInfo {
    // Required methods
    fn ident(&self) -> &Option<Ident>;
    fn vis(&self) -> &Visibility;
    fn ty(&self) -> &Type;

    // Provided method
    fn as_ident(&self, ix: usize) -> Ident { ... }
}
Expand description

Trait to retrieve fields’ properties

Required Methods§

Source

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

Retrieves the identifier of the passed-in field, or None for tuple fields

Source

fn vis(&self) -> &Visibility

Retrieves the visibility of the passed-in field

Source

fn ty(&self) -> &Type

Retrieves the type of the passed-in field

Provided Methods§

Source

fn as_ident(&self, ix: usize) -> Ident

Retrieves the ident of the field or a v_{ix} ident based on the field index

Implementors§