grizzly v0.5.0 Grizzly.Command.Encoding View Source

Utility module to validate command arguments prior to command encoding

Link to this section Summary

Functions

Verifies that the (sub)arguments of a command, possibly after encoding, meet the given type specs

Link to this section Types

Link to this type

sizable() View Source
sizable() :: :bits | :bytes

Link to this type

spec() View Source
spec() :: :byte | :byte | :integer | :binary | :bit | {sizable(), size()}

Link to this type

specs() View Source
specs() ::
  spec()
  | [spec()]
  | {:encode_with, atom()}
  | {:encode_with, atom(), atom()}
  | {:range, integer(), integer()}

Link to this section Functions

Link to this function

encode_and_validate_args(command, type_specs, sub_arguments_path \\ []) View Source
encode_and_validate_args(struct(), %{required(atom()) => specs()}, [atom()]) ::
  {:ok, struct()} | {:error, Grizzly.Command.EncodeError.t()}

Verifies that the (sub)arguments of a command, possibly after encoding, meet the given type specs