Expand description
Channel-based communication framework for OpenVMM and OpenHCL.
mesh provides typed channels (Sender<T> / Receiver<T>) that work
the same way whether the two ends are in the same process or in
different ones. Components that communicate through mesh channels can
be moved between processes without changing their code.
This is the facade crate — it re-exports the important types from the
lower-level mesh_channel, mesh_node, mesh_protobuf, and
mesh_derive crates. Most code should only depend on this crate.
§Channels
channel()— multi-producer channel (Sender<T>/Receiver<T>).oneshot()— single-use transfer (OneshotSender<T>/OneshotReceiver<T>).rpc::Rpc— request/response: bundles a request with a reply channel. The conventional pattern is an enum ofRpcvariants.Cell/CellUpdater— publish-subscribe for configuration updates.pipe—AsyncRead/AsyncWritebyte stream with backpressure.CancelContext— cooperative cancellation with deadlines.
§Message types
Any type can be sent over a channel within a single process. To cross
process boundaries, derive MeshPayload:
use mesh::rpc::Rpc;
#[derive(MeshPayload)]
enum MyRequest {
DoThing(Rpc<Input, Output>),
Stop(Rpc<(), ()>),
}MeshPayload types can include channel endpoints, file descriptors,
and OS handles as fields — these are transferred automatically when
the message crosses a process boundary.
See the mesh guide for a full introduction.
Modules§
- error
- Remotable errors.
- local_
node - message
- Implements the
Messagetype. - payload
- pipe
- Implementation a unidirectional byte stream pipe over mesh.
- resource
- Mesh resource definitions.
- rpc
- Remote Procedure Call functionality.
Structs§
- Address
- A port address.
- Cancel
- A cancel notifier.
- Cancel
Context - A cancellation context.
- Cancelled
- Cell
- A cell containing a value that can be updated from a remote node.
- Cell
Updater - A type used to update the value in one or more
Cells. - Channel
Error - An error representing a failure of a channel.
- Deadline
- A point in time that acts as a deadline for an operation.
- Message
- A message on a port.
- NodeId
- A node ID.
- Oneshot
Receiver - The receiving half of a channel returned by
oneshot. - Oneshot
Sender - The sending half of a channel returned by
oneshot. - Owned
Message - A message on a port.
- PortId
- A port ID.
- Receiver
- The receiving half of a channel returned by
channel. - Sender
- The sending half of a channel returned by
channel. - Uuid
- A unique ID.
Enums§
- Cancel
Reason - Channel
Error Kind - The kind of channel failure.
- Recv
Error - An error when receiving a message from a channel.
- TryRecv
Error - An error when trying to receive a message from a channel.
Traits§
- Mesh
Payload - Trait for types that can be constructed as a
Message.
Functions§
- cell
- Creates a new cell and its associated updater.
- channel
- Creates a new channel for sending messages of type
T, returning the sender and receiver ends. - mpsc_
channel - Creates a new channel for sending messages of type
T, returning the sender and receiver ends. - oneshot
- Creates a unidirection channel for sending a single value of type
T.
Derive Macros§
- Mesh
Payload - The derive macro for
MeshPayload.