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§
Sourcefn inner_type(&self) -> &Field
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.
Sourcefn inner_type_mut(&mut self) -> &mut Field
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.
Sourcefn is_newtype(&self) -> bool
fn is_newtype(&self) -> bool
Returns true if the AST is for a struct with exactly one unnamed field.