Struct derive_more::utils::State

source ·
pub struct State<'input> {
Show 16 fields pub input: &'input DeriveInput, pub trait_name: &'static str, pub trait_ident: Ident, pub method_ident: Ident, pub trait_module: TokenStream, pub trait_path: TokenStream, pub trait_path_params: Vec<TokenStream>, pub trait_attr: String, pub derive_type: DeriveType, pub fields: Vec<&'input Field>, pub variants: Vec<&'input Variant>, pub variant_states: Vec<State<'input>>, pub variant: Option<&'input Variant>, pub generics: Generics, pub default_info: FullMetaInfo, full_meta_infos: Vec<FullMetaInfo>,
}

Fields§

§input: &'input DeriveInput§trait_name: &'static str§trait_ident: Ident§method_ident: Ident§trait_module: TokenStream§trait_path: TokenStream§trait_path_params: Vec<TokenStream>§trait_attr: String§derive_type: DeriveType§fields: Vec<&'input Field>§variants: Vec<&'input Variant>§variant_states: Vec<State<'input>>§variant: Option<&'input Variant>§generics: Generics§default_info: FullMetaInfo§full_meta_infos: Vec<FullMetaInfo>

Implementations§

source§

impl<'input> State<'input>

source

pub fn new<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String ) -> Result<State<'arg_input>>

source

pub fn with_field_ignore<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String ) -> Result<State<'arg_input>>

source

pub fn with_field_ignore_and_forward<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String ) -> Result<State<'arg_input>>

source

pub fn with_field_ignore_and_refs<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String ) -> Result<State<'arg_input>>

source

pub fn with_attr_params<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String, allowed_attr_params: AttrParams ) -> Result<State<'arg_input>>

source

pub fn with_type_bound<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String, allowed_attr_params: AttrParams, add_type_bound: bool ) -> Result<State<'arg_input>>

source

fn new_impl<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String, allowed_attr_params: AttrParams, add_type_bound: bool ) -> Result<State<'arg_input>>

source

pub fn from_variant<'arg_input>( input: &'arg_input DeriveInput, trait_name: &'static str, trait_module: TokenStream, trait_attr: String, allowed_attr_params: AttrParams, variant: &'arg_input Variant, default_info: FullMetaInfo ) -> Result<State<'arg_input>>

source

pub fn add_trait_path_type_param(&mut self, param: TokenStream)

source

pub fn assert_single_enabled_field<'state>( &'state self ) -> SingleFieldData<'input, 'state>

source

pub fn enabled_fields_data<'state>( &'state self ) -> MultiFieldData<'input, 'state>

source

pub fn enabled_variant_data<'state>( &'state self ) -> MultiVariantData<'input, 'state>

source

fn enabled_variants(&self) -> Vec<&'input Variant>

source

fn enabled_variant_states(&self) -> Vec<&State<'input>>

source

pub fn enabled_fields(&self) -> Vec<&'input Field>

source

fn field_idents(&self) -> Vec<TokenStream>

source

fn enabled_fields_idents(&self) -> Vec<TokenStream>

source

fn enabled_fields_indexes(&self) -> Vec<usize>

source

fn enabled_infos(&self) -> Vec<FullMetaInfo>

Auto Trait Implementations§

§

impl<'input> RefUnwindSafe for State<'input>

§

impl<'input> !Send for State<'input>

§

impl<'input> !Sync for State<'input>

§

impl<'input> Unpin for State<'input>

§

impl<'input> UnwindSafe for State<'input>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.