Skip to main content

Crate wrpc_transport

Crate wrpc_transport 

Source
Expand description

wRPC transport abstractions, codec and framing

wRPC is an RPC framework based on WIT. It follows client-server model, where peers (servers) may serve function and method calls invoked by the other peers (clients).

The two main abstractions on top of which wRPC is built are:

  • Invoke - the client-side handle to a wRPC transport, allowing clients to invoke WIT functions over wRPC transport
  • Serve - the server-side handle to a wRPC transport, allowing servers to serve WIT functions over wRPC transport

Invoke and Serve establish a single bidirectional byte stream per invocation, over which wRPC layers its framing protocol to multiplex the nested async parameter and result sub-streams. Both therefore yield the framed frame::Outgoing and frame::Incoming streams regardless of the underlying transport, which only needs to provide any AsyncWrite/AsyncBufRead byte stream.

Re-exports§

pub use frame::Decoder as FrameDecoder;
pub use frame::Encoder as FrameEncoder;
pub use frame::Frame;
pub use frame::FrameRef;
pub use frame::Server;
pub use invoke::Invoke;
pub use invoke::InvokeExt;
pub use serve::Serve;
pub use serve::ServeExt;
pub use frame::tcp;
pub use frame::unix;

Modules§

frame
wRPC transport stream framing
invoke
wRPC transport client handle
serve
wRPC transport server handle

Structs§

BufferedIncoming
Buffered incoming stream used for decoding values
CanonicalNanF32Codec
Canonicalizes NaNs on encode, wrapping F32Codec.
CanonicalNanF64Codec
Canonicalizes NaNs on encode, wrapping F64Codec.
FutureDecoder
Decoder for future<T>
FutureEncoder
Encoder for future<T>
ListDecoder
Decoder for list<T>
ListDecoderU8
Decoder for list<u8>
ListEncoder
Encoder for list<T>
Packer
Sink used by pack, which collects the packed asynchronous values
ResourceBorrow
Borrowed resource handle, represented as an opaque byte blob
ResourceBorrowDecoder
Decoder for borrowed resource types
ResourceEncoder
Encoder for resource types
ResourceOwn
Owned resource handle, represented as an opaque byte blob
ResourceOwnDecoder
Decoder for owned resource types
StreamDecoder
Decoder for stream<T>
StreamDecoderBytes
Decoder for stream<list<u8>>
StreamDecoderRead
Decoder for stream<list<u8>> with AsyncRead support
StreamEncoder
Encoder for stream<T>
StreamEncoderBytes
Encoder for stream<list<u8>>
StreamEncoderRead
Encoder for stream<list<u8>> with AsyncRead support
SyncCodec
Codec for synchronous values
UnitCodec
Codec for ()

Constants§

READ_CHUNK_SIZE
Size of chunks read from byte streams

Traits§

Decode
Defines value decoding
Deferred
Handles async processing state for codecs
Encode
Defines value encoding
Index
Multiplexes asynchronous value transmission using a structural path
Sink
Target of deferred transmission of asynchronous values, encoded by Encode
TupleDecode
Marker trait for Decode tuple types
TupleEncode
Marker trait for Encode tuple types

Functions§

pack
Pack a Encode into a singular byte buffer dst.
pack_ready
Synchronously pack a Encode into a singular byte buffer dst.
unpack
Unpack a Decode from a byte buffer buf produced by pack or pack_ready.

Type Aliases§

DeferredFn
Deferred operation used for async value processing