Command

Command :: # (opaque)

A binary-safe Redis command.

Redis clients send commands as non-empty RESP arrays whose elements are bulk strings. The first element is the command name and the remaining elements are arguments. No quoting, escaping, or UTF-8 conversion is performed by the byte-oriented constructor.

new : NonEmptyBytes, List(Bytes) -> Command

Construct using a name whose non-empty invariant is already established.

to_parts : Command -> List(List(U8))

Read-only wire arguments, including the validated nonempty command name.

from_nonempty_bytes : NonEmptyBytes, List(List(U8)) -> Command

Construct a command whose byte-valued name is non-empty by construction.

Quoted names are validated by NonEmptyBytes.from_quote at compile time.

ping : () -> Command

Construct PING.

echo : List(U8) -> Command

Construct binary-safe ECHO message.

encode : Command -> List(U8)

Encode one command using the Redis client wire format.

pipeline_size : List(Command), U64 -> Try(U64, [RequestByteLimitExceeded({ limit : U64 })])

Measure before allocating the outbound buffer. Subtract from a remaining budget so even a sum exceeding U64 cannot overflow.

encode_bounded : List(Command), U64 -> Try(List(U8), [RequestByteLimitExceeded({ limit : U64 })])

Encode into one reserved buffer after the complete size check succeeds.

Error : [EmptyCommandName]