Wick.Protocol.Response (wick v0.1.0)

Copy Markdown View Source

Opcode-specific response structs and encode/1 dispatcher.

Each struct below carries the payload that follows fuse_out_header for a given opcode's success reply. Use via Wick.Protocol.encode_response/3, which prepends the shared 16-byte out-header.

Ops that have no reply body (UNLINK, RMDIR, RENAME, RELEASE, FLUSH, FSYNC, DESTROY, SETXATTR, …) and FORGET / BATCH_FORGET (no reply ever) use %Empty{}.

Summary

Functions

Decode a stream of fuse_direntplus records. Test helper that round-trips against encode/1 for ReaddirPlus responses.

Decode a stream of fuse_dirent records. Primarily a test helper that round-trips against encode/1 for Readdir responses.

Encode the response body (excluding fuse_out_header).

Types

Functions

decode_direntpluses(binary)

@spec decode_direntpluses(binary()) ::
  {:ok, [Wick.Protocol.Response.DirentPlus.t()]} | {:error, :malformed_body}

Decode a stream of fuse_direntplus records. Test helper that round-trips against encode/1 for ReaddirPlus responses.

decode_dirents(binary)

@spec decode_dirents(binary()) ::
  {:ok, [Wick.Protocol.Response.Dirent.t()]} | {:error, :malformed_body}

Decode a stream of fuse_dirent records. Primarily a test helper that round-trips against encode/1 for Readdir responses.

encode(r)

@spec encode(t()) :: iodata()

Encode the response body (excluding fuse_out_header).