Trait syn_helpers::Constructable
source · pub trait Constructable {
// Required methods
fn get_constructor_path(&self) -> Path;
fn build_constructor(
&self,
generator: impl Fn(NamedOrUnnamedField<'_>) -> Result<Expr, Box<dyn Error>>
) -> Result<Expr, Box<dyn Error>>;
fn get_fields(&self) -> &Fields;
fn get_fields_mut(&mut self) -> &mut Fields;
}
Expand description
A Rust structure which can be created (either a struct or enum variant)
Required Methods§
sourcefn get_constructor_path(&self) -> Path
fn get_constructor_path(&self) -> Path
Get the path required to construct the expression
sourcefn build_constructor(
&self,
generator: impl Fn(NamedOrUnnamedField<'_>) -> Result<Expr, Box<dyn Error>>
) -> Result<Expr, Box<dyn Error>>
fn build_constructor( &self, generator: impl Fn(NamedOrUnnamedField<'_>) -> Result<Expr, Box<dyn Error>> ) -> Result<Expr, Box<dyn Error>>
Builds a constructor expression by evaluating a expression generator for each field
fn get_fields(&self) -> &Fields
fn get_fields_mut(&mut self) -> &mut Fields
Object Safety§
This trait is not object safe.