Skip to main content

running_process/broker/protocol/
mod.rs

1//! v1 broker protocol module.
2//!
3//! Phase 0 of #228 introduced the prost-generated wire types from
4//! `proto/broker_v1_*.proto`. Phase 1 (#230) adds the framing
5//! read/write helpers used by every connection.
6//!
7//! All three .proto files share the `running_process.broker.v1`
8//! package, so prost-build emits a single Rust module containing
9//! every message and enum (Frame, Hello, HelloReply, Refused,
10//! Negotiated, AdminRequest, AdminReply, CacheManifest, ServiceDefinition,
11//! LifecycleEvent, ...).
12//! The prost-generated types are re-exported at the top of this
13//! module so existing call sites importing them under
14//! `running_process::broker::protocol::*` keep working.
15
16#[allow(missing_docs)]
17mod prost_generated {
18    include!(concat!(env!("OUT_DIR"), "/running_process.broker.v1.rs"));
19}
20
21pub use prost_generated::*;
22
23pub mod frame_ext;
24pub mod framing;
25pub mod registry;
26pub mod validate;
27
28pub use frame_ext::{
29    encode_framed, try_decode_framed, DecodedFramed, EndpointNameError, FRAME_HEADER_BYTES,
30};
31pub use framing::{
32    read_frame, read_frame_with_cap, write_frame, FramingError, ENVELOPE_VERSION, MAX_FRAME_BYTES,
33    MAX_HELLO_BYTES,
34};
35pub use registry::{
36    ADMIN_PAYLOAD_PROTOCOL, BACKEND_HANDLE_PROBE_PAYLOAD_PROTOCOL, CONTROL_PAYLOAD_PROTOCOL,
37    FBUILD_PAYLOAD_PROTOCOL, HANDOFF_PAYLOAD_PROTOCOL, PROTOCOL_VERSION, ZCCACHE_PAYLOAD_PROTOCOL,
38};
39pub use validate::{validate_frame_envelope, FrameValidationError};