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§
Sourcefn non_exhaustive_arm_pattern(
&self,
prefix: &str,
skipped_indices: &HashSet<usize, DeterministicState>,
) -> TokenStream
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.
Sourcefn exhaustive_arm_pattern(&self, prefix: &str) -> TokenStream
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.