Zodish.Type protocol (zodish v0.2.4)

View Source

Protocol for parsing values based on Zodish types.

Summary

Types

t()

All the types that implement this protocol.

Functions

Parses a value based on the given Zodish type.

Builds the type spec for a given Zodish type.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

parse(type, value)

@spec parse(type :: t(), value :: any()) :: {:ok, any()} | {:error, Zodish.Issue.t()}

Parses a value based on the given Zodish type.

to_spec(type)

@spec to_spec(type :: t()) :: Macro.t()

Builds the type spec for a given Zodish type.