Decoder (Decoder v0.1.0)

View Source

Summary

Functions

any(options \\ [])

@spec any(Keyword.t()) :: map()

atom(options \\ [])

@spec atom(Keyword.t()) :: map()

boolean(options \\ [])

@spec boolean(Keyword.t()) :: map()

decode(schema, input, options \\ [])

@spec decode(map(), any(), Keyword.t()) :: {:ok, any()} | {:error, binary() | list()}

integer(options \\ [])

@spec integer(Keyword.t()) :: map() | {:error, binary()}

list(item, options \\ [])

@spec list(map(), Keyword.t()) :: map() | {:error, binary()}
@spec list(map(), Keyword.t()) :: map() | {:error, binary()}
@spec list(any(), any()) :: {:error, binary()}

literal(value, options \\ [])

@spec literal(any(), Keyword.t()) :: map() | {:error, binary()}

map(properties, options \\ [])

@spec map(map(), Keyword.t()) :: map() | {:error, binary()}
@spec map(map(), Keyword.t()) :: map() | {:error, binary()}
@spec map(any(), any()) :: {:error, binary()}

nil!(options \\ [])

@spec nil!(Keyword.t()) :: map()

optional(value)

@spec optional(map()) :: map() | {:error, binary()}
@spec optional(any()) :: {:error, binary()}

record(key, value, options \\ [])

@spec record(map(), map(), Keyword.t()) :: map() | {:error, binary()}
@spec record(map(), map(), Keyword.t()) :: map() | {:error, binary()}
@spec record(any(), any(), any()) :: {:error, binary()}

string()

@spec string() :: map()

string(regex)

@spec string(Regex.t()) :: map() | {:error, binary()}
@spec string(any()) :: {:error, binary()}

string(regex, options)

@spec string(Regex.t(), Keyword.t()) :: map() | {:error, binary()}
@spec string(any(), any()) :: {:error, binary()}

tuple(items, options \\ [])

@spec tuple(list(), Keyword.t()) :: map() | {:error, binary()}
@spec tuple(list(), Keyword.t()) :: map() | {:error, binary()}
@spec tuple(any(), any()) :: {:error, binary()}

union(values, options \\ [])

@spec union([map()], Keyword.t()) :: map() | {:error, binary()}
@spec union(any(), any()) :: {:error, binary()}