Crate capnp [] [src]

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

any_pointer

Dynamically typed value.

capability

Hooks for for the RPC system.

capability_list

List of capabilities.

constant

Helper type for generated Struct and List constants.

data

Sequence of bytes.

data_list

List of sequences of bytes.

enum_list

List of enums.

list_list

List of lists.

message

Untyped root container for a Cap'n Proto value.

primitive_list

List of primitives.

private

Implementation details that should never be directly used by clients.

serialize

Reading and writing of messages using the standard stream framing.

serialize_packed

Reading and writing of messages using the packed stream encoding.

struct_list

List of structs.

text

UTF-8 encoded text.

text_list

List of strings containing UTF-8 encoded text.

traits

Macros

capnp_word

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

Error

Describes an arbitrary error that prevented an operation from completing.

MessageSize

Size of a message. Every generated struct has a method .total_size() that returns this.

NotInSchema

An enum value or union discriminant that was not found among those defined in a schema.

Word

Eight bytes of memory with opaque interior. Use capnp_word!() to construct one of these.

Enums

ErrorKind

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.

OutputSegments

Helper struct that allows MessageBuilder::get_segments_for_output() to avoid heap allocations in the single-segment case.

Type Definitions

Result

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