Expand description
§Aurelia
An embeddable service mesh for Rust applications. Aurelia gives a Rust process a built-in, authenticated peer-to-peer fabric — no sidecar, no control plane, no extra runtime to deploy.
§Layer model
- A0 — Transport authentication. mTLS over TCP, or PKCS#8 certificate-backed authentication over Unix domain sockets. A0 completes before any A1 frames are exchanged.
- A1 — Message and blob transfer. Delivery, callis (per-peer connection flow), and taberna (named inbound endpoint) management.
- A2 — Aurelia services. Higher-level capabilities built on A1 (in progress; the current release ships A0 and A1 with the wrapper API).
- A3 — Application. Your code. All A3-to-A3 traffic transits A1.
§Quick start
Initialise the Aurelia runtime and build a Domus (the local peer)
bound to a TCP address with PKCS#8 mTLS material:
use std::sync::Arc;
use aurelia::{Aurelia, DomusAddr, DomusConfigBuilder,
Pkcs8AuthConfig, Pkcs8PemConfig, SimpleResolver};
let aurelia = Aurelia::new();
let config = DomusConfigBuilder::new().build()?;
let auth = Pkcs8AuthConfig::Pkcs8Pem(Pkcs8PemConfig {
ca_pem: std::fs::read("ca.pem").unwrap(),
cert_pem: std::fs::read("cert.pem").unwrap(),
pkcs8_key_pem: std::fs::read("key.pem").unwrap().into(),
});
let domus = aurelia
.domus_builder(
config,
DomusAddr::Tcp("127.0.0.1:7000".parse().unwrap()),
auth,
Arc::new(SimpleResolver::new()),
)
.build()
.await?;
// Use `domus.taberna(...)` to register inbound endpoints, and
// `domus.send(...)` to dispatch messages to peers.§Where to look next
Aurelia— runtime initializer and entry point.DomusBuilder— configures and builds aDomus.Domus— the running local peer.Taberna— a named inbound endpoint on a domus.DomusConfig/DomusConfigBuilder— tuning knobs and validation.AureliaError/ErrorId— the single error type used across the API.DomusReporting/DomusReportingEvent— observability streams.a3_message_type— derives application message-type IDs in the A3 range.
Structs§
- Aurelia
- Runtime owner and entry point for the Aurelia library.
- Aurelia
Error - The single error type used across Aurelia. Carries a stable
ErrorIddiscriminant and an optional human-readable message; thekindis the field applications match on. - Blob
Callis Settings Report - Snapshot of blob-callis settings reported alongside connection events.
- Blob
Receiver - Inbound blob stream attached to a callis. Implements
AsyncRead. - Blob
Sender - Outbound blob stream attached to a callis. Implements
AsyncWrite. - Blob
Window Config - Blob chunk size and acknowledgment window configured as one pair.
- Domus
- A running Aurelia domus: the local peer’s representation in the mesh.
- Domus
Builder - Builder for a
Domuswired to the Aurelia runtime. - Domus
Config - Tunable parameters for a
crate::peering::Domus. Construct viaDomusConfigBuilderor start fromDomusConfig::defaultand override individual fields. - Domus
Config Access - Live handle to a running
crate::peering::Domus’s configuration. Allows taking a current snapshot and applying validated updates without restarting the domus. - Domus
Config Builder - Fluent builder for
DomusConfig. Each setter overrides the matching field and returnsSelffor chaining;DomusConfigBuilder::buildvalidates the final configuration. - Domus
Metrics - Cumulative counters for a
crate::peering::Domus, obtained viacrate::peering::DomusReporting::snapshot. - Domus
Metrics Delta - Counter deltas since the previous reset, obtained via
crate::peering::DomusReporting::snapshot_and_reset. Cumulative counters report the increment over the prior reset interval; gauges (current_*,peak_*over the interval) report current values. - Domus
Reporting - Observability handle obtained from
crate::peering::Domus::reporting. Provides snapshot access to metrics, enumeration of connected peers, and pub-sub access to the live event and error streams. - Domus
Reporting Feeds - Bundled live broadcast receivers for events and errors, returned by
DomusBuilder::build_with_reportingorDomusReporting::feeds. - Encoded
Message - Wire-ready application message: a type discriminator plus its serialised payload.
- Peer
Identity Report - Identity report for a connected peer, used when enumerating peers via
crate::peering::observability::DomusReporting::connected_peers. - Pkcs8
DerConfig - PKCS#8 mTLS material in DER form.
- Pkcs8
PemConfig - PKCS#8 mTLS material in PEM form.
- Pkcs8
Private Key - PKCS#8 private-key bytes that zeroize on drop after ownership is transferred.
- Send
Options - Per-send flags controlling whether a callis carries an attached blob.
- Simple
Resolver - In-memory
RouteResolverbacked by a mutable map fromTabernaIdtoDomusAddr. Suitable for tests, fixtures, and applications with a small static topology. - Taberna
- A registered inbound endpoint on a
Domus. - Taberna
Completion - Completion guard for a taberna request.
- Taberna
Request - A single inbound delivery handed to the application. The application
must acknowledge the request by calling either
TabernaRequest::acceptorTabernaRequest::reject; dropping the request without a decision is treated as rejection. - Taberna
Request Parts - Application-owned pieces of a split
TabernaRequest.
Enums§
- Domus
Addr - Network address of a domus peer, abstracting over the supported transports.
- Domus
Reporting Event - Event surfaced on the
crate::peering::observability::DomusReportingevent stream. - ErrorId
- Stable error identifier carried by every
AureliaError. Each variant corresponds to a distinct failure mode in the Aurelia stack; semantics are stable across releases so applications can match on them safely. - Message
Priority Class - Priority class for a
MessageTypeon the primary callis. - Pkcs8
Auth Config - PKCS#8 mTLS material supplied when building a
crate::peering::Domus. - Send
Outcome - Result of a successful send call.
- Transport
Kind - Tag identifying which transport a
DomusAddruses.
Constants§
- A1_
MESSAGE_ TYPE_ MAX - Last
MessageTypein the A1 transport-control priority range. - A2_
MESSAGE_ TYPE_ BASE - First
MessageTypein the A2 Aurelia-service priority range. - A2_
MESSAGE_ TYPE_ MAX - Last
MessageTypein the A2 Aurelia-service priority range. - A3_
MESSAGE_ TYPE_ BASE - First
MessageTypein the A3 application range. - A3_
MESSAGE_ TYPE_ MAX_ OFFSET - Largest offset accepted by
a3_message_typeandtry_a3_message_type.
Traits§
- Message
Codec - Application-supplied codec used by Aurelia to translate between typed application messages and the wire form transferred between peers.
- Route
Resolver - Application-supplied resolver that maps a target
TabernaIdto theDomusAddrof the peer hosting it. Aurelia calls this on every send so applications can implement service discovery as they see fit.
Functions§
- a3_
message_ type - Returns the A3 application
MessageTypefor an offset fromA3_MESSAGE_TYPE_BASE. - classify_
message_ priority - Classifies a
MessageTypeinto the A1/A2/A3 outbound priority ranges. - try_
a3_ message_ type - Returns the A3 application
MessageTypeforoffset, orNoneif it would exceedu32.
Type Aliases§
- Message
Type - Application-defined message type discriminator on the wire.
- Taberna
Id - Stable identifier for a
crate::ids::Taberna.