Trait DeriveInputNewtypeExt

Source
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§