Estructura.Nested.Type behaviour (estructura v1.8.0)

View Source

The type to be used for coercing, validating, and generation of the implementation’s instances.

Summary

Callbacks

Coerces the value coming from outside

The generator for the type

The generator for the type accepting options

Validates the value as being correct

Callbacks

coerce(term)

@callback coerce(term()) :: {:ok, term()} | {:error, any()}

Coerces the value coming from outside

generate()

@callback generate() :: StreamData.t(any())

The generator for the type

generate(keyword)

@callback generate(keyword()) :: StreamData.t(any())

The generator for the type accepting options

validate(term)

@callback validate(term()) :: {:ok, term()} | {:error, any()}

Validates the value as being correct