View Source Myrmidex.GeneratorSchema behaviour (myrmidex v0.3.1)
Behaviour defining the contract for a GeneratorSchema module.
GeneratorSchemas map terms, or fields defining the types
of map or struct fields, into StreamData generators. See Myrmidex.GeneratorSchemas.Default.
Summary
Callbacks
Callback defining custom generator mappings per term
Callback defining custom generator mappings per field--type tuple
Functions
Generates code to delegate to another generator schema in the case of no
matching cast_field/2 implementations. Should be called last in a generator
schema module.
Callbacks
@callback cast(term(), opts :: keyword()) :: StreamData.t(term())
Callback defining custom generator mappings per term
@callback cast_field(Myrmidex.Field.t(), opts :: keyword()) :: StreamData.t(term())
Callback defining custom generator mappings per field--type tuple
Functions
Generates code to delegate to another generator schema in the case of no
matching cast_field/2 implementations. Should be called last in a generator
schema module.