Crate capnp

source ·
Expand description

Cap’n Proto Runtime Library

This crate contains basic facilities for reading and writing Cap’n Proto messages in Rust. It is intended to be used in conjunction with code generated by the capnpc-rust crate.

Modules

Dynamically typed value.
Hooks for for the RPC system.
List of capabilities.
Helper type for generated Struct and List constants.
Sequence of bytes.
List of sequences of bytes.
List of enums.
List of lists.
Untyped root container for a Cap’n Proto value.
List of primitives.
Implementation details that should never be directly used by clients.
Reading and writing of messages using the standard stream framing.
Reading and writing of messages using the packed stream encoding.
List of structs.
UTF-8 encoded text.
List of strings containing UTF-8 encoded text.

Macros

Constructs a Word from its constituent bytes, accounting for endianness. This macro can be used to construct constants. In the future, once Rust supports constant functions, this macro will be replaced by such a function.

Structs

Describes an arbitrary error that prevented an operation from completing.
Size of a message. Every generated struct has a method .total_size() that returns this.
An enum value or union discriminant that was not found among those defined in a schema.
Eight bytes of memory with opaque interior. Use capnp_word!() to construct one of these.

Enums

The general nature of an error. The purpose of this enum is not to describe the error itself, but rather to describe how the client might want to respond to the error.
Helper struct that allows MessageBuilder::get_segments_for_output() to avoid heap allocations in the single-segment case.

Type Definitions

Because messages are lazily validated, the return type of any method that reads a pointer field must be wrapped in a Result.