[][src]Trait proc_macro_roids::DeriveInputStructExt

pub trait DeriveInputStructExt {
    fn data_struct(&self) -> &DataStruct;
fn data_struct_mut(&mut self) -> &mut DataStruct;
fn fields(&self) -> &Fields;
fn fields_mut(&mut self) -> &mut Fields;
fn fields_named(&self) -> &FieldsNamed;
fn fields_named_mut(&mut self) -> &mut FieldsNamed; }

Functions to make it ergonomic to work with struct ASTs.

Required methods

fn data_struct(&self) -> &DataStruct

Returns a reference to the data_struct of a struct's AST.

Panics

Panics if the AST is not for a struct.

fn data_struct_mut(&mut self) -> &mut DataStruct

Returns a mutable reference to the data_struct of a struct's AST.

Panics

Panics if the AST is not for a struct.

fn fields(&self) -> &Fields

Returns a reference to the fields of a struct's AST.

Panics

Panics if the AST is not for a struct.

fn fields_mut(&mut self) -> &mut Fields

Returns a mutable reference to the fields of a struct's AST.

Panics

Panics if the AST is not for a struct.

fn fields_named(&self) -> &FieldsNamed

Returns a mutable reference to the named fields of a struct's AST.

Panics

Panics if the AST is not for a struct with named fields.

fn fields_named_mut(&mut self) -> &mut FieldsNamed

Returns a mutable reference to the named fields of a struct's AST.

Panics

Panics if the AST is not for a struct with named fields.

Loading content...

Implementations on Foreign Types

impl DeriveInputStructExt for DeriveInput[src]

Loading content...

Implementors

Loading content...