FieldsExt

Trait FieldsExt 

Source
pub(crate) trait FieldsExt {
    // Required methods
    fn non_exhaustive_arm_pattern(
        &self,
        prefix: &str,
        skipped_indices: &HashSet<usize, DeterministicState>,
    ) -> TokenStream;
    fn exhaustive_arm_pattern(&self, prefix: &str) -> TokenStream;
}
Expand description

Extension of syn::Fields for pattern matching code generation.

Required Methods§

Source

fn non_exhaustive_arm_pattern( &self, prefix: &str, skipped_indices: &HashSet<usize, DeterministicState>, ) -> TokenStream

Generates a pattern for matching these syn::Fields non-exhaustively (considering the provided skipped_indices) in an arm of a match expression.

All the syn::Fields will be assigned as {prefix}{num} bindings for use.

Source

fn exhaustive_arm_pattern(&self, prefix: &str) -> TokenStream

Generates a pattern for matching these syn::Fields exhaustively in an arm of a match expression.

All the syn::Fields will be assigned as {prefix}{num} bindings for use.

Implementations on Foreign Types§

Source§

impl FieldsExt for Fields

Implementors§