apps/libtmux_erlang/src/tmux_matcher.erl

Source at 4d73c9795adca3e49eea74d1d2cbbbbdcbea0b6c

SHA-256: b599f732e73ad9c7701df6c9c65c9524645c988bb5ba2d0729b9004136d29c16

-module(tmux_matcher).
-moduledoc """
Prepare a trusted local predicate once for a captured snapshot.

Use `tmux_select:matching/2` with `{Module, State}`. The application chooses
Module; external filter documents cannot select the `c:prepare/2`
callback. Preparation returns a unary Boolean function or a tagged error.
Callback exceptions propagate. The adapter does not make executable predicates
portable or push them to tmux.
""".
-doc """
Prepare a local Boolean predicate once for this captured snapshot. Return a
tagged preparation error when the matcher cannot operate. Callback exceptions
remain application failures; this does not make a matcher portable or suitable
for untrusted module selection.
""".
-callback prepare(State :: term(), Snapshot :: tmux_snapshot:t()) ->
    {ok, fun((tmux_model:row()) -> boolean())} | {error, term()}.