View Source Kvasir.Type behaviour (kvasir v0.0.18)

Link to this section Summary

Functions

Lookup a base type.

Link to this section Types

@type base() ::
  atom()
  | boolean()
  | integer()
  | String.t()
  | [base()]
  | %{optional(base()) => base()}
@type t() :: atom()

Link to this section Callbacks

@callback describe(value :: term()) :: String.t()
@callback doc() :: String.t()

Type documentation.

@callback dump(value :: term()) :: {:ok, term()} | {:error, atom()}
@callback dump(value :: term(), opts :: Keyword.t()) :: {:ok, term()} | {:error, atom()}
@callback name() :: String.t()

Type descriptive name.

@callback obfuscate(value :: term()) :: {:ok, term()} | :obfuscate | {:error, atom()}
@callback obfuscate(value :: term(), opts :: Keyword.t()) ::
  {:ok, term()} | :obfuscate | {:error, atom()}
@callback parse(value :: any()) :: {:ok, term()} | {:error, atom()}
@callback parse(value :: any(), opts :: Keyword.t()) :: {:ok, term()} | {:error, atom()}

Link to this section Functions

@spec lookup(atom()) :: atom()

Lookup a base type.