tyyppi v0.1.0 Tyyppi.Example View Source
Example of the structure defined with Tyyppi.Struct.defstruct/1
The original code of this module follows:
import Kernel, except: [defstruct: 1]
import Tyyppi.Struct, only: [defstruct: 1]
@typedoc "The user type defined before `defstruct/1` declaration"
@type my_type :: :ok | {:error, term()}
defstruct foo: atom(), bar: GenServer.on_start(), baz: my_type()
Link to this section Summary
Types
The user type defined before defstruct/1
declaration
Link to this section Types
Specs
my_type() :: :ok | {:error, term()}
The user type defined before defstruct/1
declaration
Specs
t() :: %Tyyppi.Example{foo: atom(), bar: GenServer.on_start(), baz: my_type()}
The type describing this struct. This type will be used to validate
upserts when called via Access
and/or Tyyppi.Example.put/3
,
Tyyppi.Example.update/4
.
Link to this section Functions
Returns the field types of this struct as keyword of
{field :: atom, type :: Tyyppi.T.t()}
pairs.