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§

source

fn get_constructor_path(&self) -> Path

Get the path required to construct the expression

source

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

source

fn get_fields(&self) -> &Fields

source

fn get_fields_mut(&mut self) -> &mut Fields

Object Safety§

This trait is not object safe.

Implementors§