Trait proc_macro_roids::FieldsExt
source · pub trait FieldsExt {
// Required methods
fn is_unit(&self) -> bool;
fn is_named(&self) -> bool;
fn is_tuple(&self) -> bool;
fn construction_form(&self) -> TokenStream;
}
Expand description
Functions to make it ergonomic to work with Fields
.
Required Methods§
sourcefn construction_form(&self) -> TokenStream
fn construction_form(&self) -> TokenStream
Returns a token stream of the construction form of the fields.
For unit fields, this returns an empty token stream.
- Tuple fields:
(_0, _1,)
- Named fields:
{ field_0, field_1 }