Wick.Protocol.Request (wick v0.1.0)

Copy Markdown View Source

Opcode-specific request structs and decode/2 dispatcher.

Each opcode's payload layout is taken verbatim from Linux's include/uapi/linux/fuse.h v7.31. Filenames in request bodies are always NUL-terminated and are decoded without the terminator.

Summary

Functions

Decode a body for the given opcode. Returns the populated struct or {:error, :malformed_body} when the bytes don't match the expected layout.

Types

Functions

decode(arg1, body)

@spec decode(atom(), binary()) :: {:ok, t()} | {:error, :malformed_body}

Decode a body for the given opcode. Returns the populated struct or {:error, :malformed_body} when the bytes don't match the expected layout.