Breakfast v0.1.4 Breakfast.Field View Source

The %Elixir.Breakfast.Field{} struct contains all the information related to a particular field on a struct created with cereal:

  • mod: The name of the module that defines this field
  • name: The name of the field
  • type: The type of the field
  • fetcher: The function that'll be used to fetch the value for this field
  • caster: The function that'll be used to cast the value for this field
  • validator: The function that'll be used to validate the value for this field
  • default: The default value

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Breakfast.Field{
  caster: (atom() | (any() -> {:ok, any()} | :error) | :default) | nil,
  default: ({:ok, term()} | :error) | nil,
  fetcher: (atom() | (any(), any() -> any()) | :default) | nil,
  mod: module() | nil,
  name: atom() | nil,
  type: type() | nil,
  validator: (atom() | (any() -> [any()]) | :default) | nil
}
Link to this type

type()

View Source
type() :: atom() | {:cereal, module()} | {atom(), term()}