pub trait DeriveInputNewtypeExt {
    // Required methods
    fn inner_type(&self) -> &Field;
    fn inner_type_mut(&mut self) -> &mut Field;
    fn is_newtype(&self) -> bool;
}
Expand description

Functions to make it ergonomic to work with newtype struct ASTs.

Required Methods§

source

fn inner_type(&self) -> &Field

Returns the Field of the first unnamed field of this struct’s AST.

Panics

Panics if the AST is not for a newtype struct.

source

fn inner_type_mut(&mut self) -> &mut Field

Returns the Field of the first unnamed field of this struct’s AST.

Panics

Panics if the AST is not for a newtype struct.

source

fn is_newtype(&self) -> bool

Returns true if the AST is for a struct with exactly one unnamed field.

Implementations on Foreign Types§

source§

impl DeriveInputNewtypeExt for DeriveInput

source§

fn inner_type(&self) -> &Field

source§

fn inner_type_mut(&mut self) -> &mut Field

source§

fn is_newtype(&self) -> bool

Implementors§