Compile-time DSL entrypoint for Musubi input-object schemas.
Input modules are pure data types used as command-payload field shapes.
They are distinct from Musubi.State (render output) and Musubi.Store
(mountable runtime nodes): no mount/1, no render/1, no commands, no
streams, no child eligibility. Only typed fields and validation.
Inputs participate in:
Musubi.Wire— auto-derived so input structs serialize like state.Musubi.Type.valid?/3—Module.t()references to an input module recurse via__musubi_validate_input__/1.Musubi.Hooks.ValidateCommandSchema— payload fields typedMyInput.t()validate by recursing into the input module.
Examples
defmodule UserInput do
use Musubi.Input
input do
field :name, String.t()
field :age, integer()
end
end
Summary
Functions
Sets up a module to declare a reusable Musubi input with input do ... end.
Returns whether module is a Musubi input-object module.
Functions
Sets up a module to declare a reusable Musubi input with input do ... end.
Examples
defmodule UserInput do
use Musubi.Input
input do
field :name, String.t()
end
end
Returns whether module is a Musubi input-object module.
Examples
iex> defmodule InputKindExample do
...> use Musubi.Input
...> input do
...> field :name, String.t()
...> end
...> end
iex> Musubi.Input.input_module?(InputKindExample)
true
iex> Musubi.Input.input_module?(Musubi.Socket)
false