Mutare.CallRouting.ArgumentRoutes (mutare v0.1.0)

Copy Markdown View Source

The resolved argument treatments returned by Mutare.CallRouting.route_arguments/2.

visible aligns exactly with Mutare.CallRouting.Call.arguments. piped is nil for an unpiped call and carries the treatment of the pipe's left side for a piped call. Constructors validate this shape immediately (and normalize each treatment — a keyed refinement written [leading, key: treatment, …] is stored in its internal form); Mutare validates callback results again at the boundary.

Summary

Functions

Build routes in effective-argument order, matching static route declarations.

Build routes from the visible arguments.

The pipe-left treatment, or nil when the call is not piped.

The treatments aligned with the written call's visible arguments.

Types

t()

@opaque t()

Functions

from_effective(call, routes)

@spec from_effective(Mutare.CallRouting.Call.t(), [Mutare.CallRouting.treatment()]) ::
  t()

Build routes in effective-argument order, matching static route declarations.

For an unpiped call, routes must have one entry per visible argument. For a piped call, its first entry routes the pipe's left side and the remainder route the visible arguments.

from_visible(call, routes, opts \\ [])

@spec from_visible(
  Mutare.CallRouting.Call.t(),
  [Mutare.CallRouting.treatment()],
  keyword()
) :: t()

Build routes from the visible arguments.

A piped call defaults its hidden first argument to :expression; pass piped: treatment when the macro gives that position different semantics.

piped(argument_routes)

@spec piped(t()) :: Mutare.CallRouting.treatment() | nil

The pipe-left treatment, or nil when the call is not piped.

visible(argument_routes)

@spec visible(t()) :: [Mutare.CallRouting.treatment()]

The treatments aligned with the written call's visible arguments.