View Source Vx.Validatable protocol (Vx v0.1.0)

The Validatable protocol that is implemented by all types of the Vx type system. As a fallback, any value not having an implementation for the Vx.Validatable protocol is considered a Vx.Literal when passed to validate/2.

Summary

Types

t()

All the types that implement this protocol.

Functions

Validates a value against a given validatable.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

validate(validatable, value)

View Source
@spec validate(t(), any()) :: :ok | {:error, String.t()}

Validates a value against a given validatable.