pub struct Generator<'a> {
pub structure_path: &'a str,
pub config_path: &'a str,
pub output_dir: &'a str,
pub schema: Option<Schema>,
pub config: Option<Value>,
pub definitions: BTreeMap<String, Schema>,
}Fields§
§structure_path: &'a str§config_path: &'a str§output_dir: &'a strThe output dir
schema: Option<Schema>§config: Option<Value>§definitions: BTreeMap<String, Schema>Implementations§
Source§impl<'a> Generator<'a>
impl<'a> Generator<'a>
pub fn generate_handler(&self, schema: &Schema) -> String
pub fn expand_handler_patterns( &self, enum_name: &String, variants: &VariantArray, ) -> Vec<String>
pub fn expand_handler_functions(&self, variants: &VariantArray) -> Vec<String>
pub fn expand_function_body(&self, variant: &Variant) -> String
pub fn expand_entity_assignment( &self, assignments: &mut Vec<String>, inner_schema: &Schema, )
Source§impl<'a> Generator<'a>
impl<'a> Generator<'a>
pub fn generate_instruction(&self, schema: &Schema) -> String
pub fn expand_schema(&self, out: &mut String, name: &String, schema: &Schema)
pub fn expand_fields(&self, properties: &PropertyArray) -> String
pub fn expand_variants(&self, variants: &VariantArray) -> String
pub fn expand_struct_unpack(&self, name: &String, schema: &Schema) -> String
pub fn expand_enum_unpack(&self, name: &String, schema: &Schema) -> String
pub fn expand_data_unpack(&self, field_name: &str, data_type: &str) -> String
Sourcepub fn is_option_value(&self, property: &Property) -> bool
pub fn is_option_value(&self, property: &Property) -> bool
Return true if value of a property is optional A property can be none when unpacking if Property is not a vector, data_type is NonZero* or some user defined struct or enum
pub fn expand_property_unpack(&self, property: &Property) -> String
pub fn expand_variant_unpack(&self, name: &String, variant: &Variant) -> String
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Generator<'a>
impl<'a> RefUnwindSafe for Generator<'a>
impl<'a> Send for Generator<'a>
impl<'a> Sync for Generator<'a>
impl<'a> Unpin for Generator<'a>
impl<'a> UnwindSafe for Generator<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more