API Reference estructura v#1.9.0
View SourceModules
Estructura
is a set of extensions for Elixir structures,
such as Access
implementation, Enumerable
and Collectable
implementations, validations and test data generation via StreamData
.
The implementation of Estructura
ready to work with tree AST-like structure
Behaviour for coercion delegates. Instead of implementing the coercion handlers
in Estructura.Nested
inplace, one might do
Coercer for :atom
, coercing strings by a call to String.to_existing_atom/1
Default coercer for :date
, coercing strings (ISO8601) and integers (epoch)
Default coercer for :datetime
, coercing strings (ISO8601) and integers (epoch)
Default coercer for :datetime
, coercing strings (ISO8601) and integers (epoch)
Default coercer for :float
, coercing strings and integers by multiplying by 1.0
Default coercer for :integer
, coercing strings and floats by rounding
Nullable coercer for :date
, coercing strings and floats by rounding, allows nil
value
Nullable coercer for :datetime
, coercing strings and floats by rounding, allows nil
value
Nullable coercer for :float
, coercing strings and floats by rounding, allows nil
value
Nullable coercer for :integer
, coercing strings and floats by rounding, allows nil
value
Nullable coercer for :time
, coercing strings and floats by rounding, allows nil
value
Default coercer for :time
, coercing strings (ISO8601) and integers (epoch)
The configuration of the Estructura
that is built from the parameters,
passed as a second argument in a call to use Estructura
.
Full Example
The field stub allowing lazy instantiation of Estructura
fields.
The implementation of lazy map implementing lazy Access
for its keys.
The nested struct with helpers to easily describe it and produce validation, coercion, and generation helpers.
The type to be used for coercing, validating, and generation of the implementation’s instances.
Estructura
type implementation for handling Date
values.
Estructura
type implementation for handling DateTime
values.
Estructura
type scaffold for creating enumerated types with a limited set of valid values.
Estructura
type for Date
Estructura
type for a set of predefined values, might be used as an implementation generator.
Estructura
type implementation for handling Time
values.
Estructura
type implementation for handling URI
values.
Estructura
type for UUID
Additional generators to be used with __generator__/1
generated by Use Estructura
Nested example. The source code of the file follows.