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
16pub use running_process_protocol::broker::v1::*;
17
18/// Compatibility path for the canonical buffer-level v1 codec.
19pub mod frame_ext {
20    pub use crate::frame_v1::{
21        encode_framed, try_decode_framed, DecodedFramed, FRAME_HEADER_BYTES,
22    };
23}
24
25/// Compatibility path for the canonical stream-level v1 framing helpers.
26pub mod framing {
27    pub use crate::frame_v1::{
28        read_frame, read_frame_with_cap, write_frame, FramingError, ENVELOPE_VERSION,
29        MAX_FRAME_BYTES, MAX_HELLO_BYTES,
30    };
31}
32
33/// Compatibility path for the canonical v1 payload-protocol registry.
34pub mod registry {
35    pub use crate::frame_v1::registry::*;
36    pub use crate::frame_v1::FRAMING_VERSION_V1;
37}
38pub mod validate;
39
40pub use crate::frame_v1::registry::{
41    ADMIN_PAYLOAD_PROTOCOL, BACKEND_HANDLE_PROBE_PAYLOAD_PROTOCOL, CONTROL_PAYLOAD_PROTOCOL,
42    FBUILD_PAYLOAD_PROTOCOL, HANDOFF_PAYLOAD_PROTOCOL, PROTOCOL_VERSION, SESSION_PAYLOAD_PROTOCOL,
43    ZCCACHE_PAYLOAD_PROTOCOL,
44};
45pub use crate::frame_v1::{
46    encode_framed, read_frame, read_frame_with_cap, try_decode_framed, write_frame, DecodedFramed,
47    FramingError, ENVELOPE_VERSION, FRAME_HEADER_BYTES, MAX_FRAME_BYTES, MAX_HELLO_BYTES,
48};
49pub use running_process_protocol::EndpointNameError;
50pub use validate::{validate_frame_envelope, FrameValidationError};