Skip to main content

actordb_protocol/
lib.rs

1//! Committed Prost bindings and stable limits for peer and application protocols.
2//!
3//! Regenerate with `cargo run -p actordb-protocol --features codegen --bin generate`.
4//! Append `-- --check` to verify schema/binding agreement without writing files.
5pub mod meta {
6    include!("generated/meta.rs");
7}
8#[allow(clippy::large_enum_variant)]
9pub mod client {
10    include!("generated/client.rs");
11}
12
13mod version;
14/// Per-write acknowledgement policy and progress receipts.
15pub mod write_concern;
16pub use version::RecordVersion;
17
18impl client::Value {
19    /// Physical/logical timestamp; compare writer identity after this pair.
20    pub fn version(&self) -> RecordVersion {
21        RecordVersion::new(self.timestamp_ms, self.logical_counter)
22    }
23}
24
25/// Peer framing limit; independent of the application RPC adapter.
26pub const MAX_FRAME_BYTES: usize = 16 * 1024 * 1024;
27pub const MAX_RPC_MESSAGE_BYTES: usize = 16 * 1024 * 1024;
28pub const MAX_BATCH_ITEMS: usize = 4096;
29pub const RPC_SERVICE_NAME: &str = "actordb.rpc.v1.ActorDb";
30pub const RPC_CALL_PATH: &str = "/actordb.rpc.v1.ActorDb/Call";
31
32mod client_decode;
33pub use client_decode::{
34    preflight_rpc_request, preflight_rpc_response, preflight_rpc_response_unchecked_shape,
35    RpcDecodeReport, RpcResponseShape, DEFAULT_MAX_DECODED_RESPONSE_BYTES,
36    PORTABLE_CELL_HEADER_CHARGE,
37};
38
39#[cfg(feature = "grpc")]
40pub mod grpc;
41/// Framework-neutral client/service traits, ownership, and request envelopes.
42pub mod rpc;