RGBMatrix.Animation.Config.FieldType behaviour (rgb_matrix v0.1.0) View Source

Provides a behaviour for defining animation configuration field types.

Link to this section Summary

Types

The possible error atoms during validation and update of configs

Module names for defined field types

t()

A field struct, containing all defined config information for that specific field.

A value which is appropriate for a defined field and does not require casting to be used for config creation or update.

Link to this section Types

Specs

error() :: :invalid_value | :undefined_field | :wrong_type

The possible error atoms during validation and update of configs

Specs

submodule() ::
  RGBMatrix.Animation.Config.FieldType.Integer
  | RGBMatrix.Animation.Config.FieldType.Option

Module names for defined field types

Specs

A field struct, containing all defined config information for that specific field.

Specs

A value which is appropriate for a defined field and does not require casting to be used for config creation or update.

Link to this section Callbacks

Specs

cast(t(), any()) :: {:ok, value()} | {:error, :wrong_type | :invalid_value}

Specs

validate(t(), value()) :: :ok | {:error, :invalid_value}