Skip to main content

rstmdb_protocol/
lib.rs

1//! # rstmdb-protocol
2//!
3//! Wire protocol implementation for rstmdb (RCP - rstmdb Command Protocol).
4//!
5//! This crate provides:
6//! - Binary framing with length prefix and CRC32C validation
7//! - JSON message serialization/deserialization
8//! - Request/Response envelope types
9//! - Error codes and protocol constants
10
11pub mod codec;
12pub mod error;
13pub mod frame;
14pub mod message;
15
16pub use codec::{Decoder, Encoder};
17pub use error::{ErrorCode, ProtocolError};
18pub use frame::{Frame, FrameFlags, FRAME_HEADER_SIZE, MAGIC};
19pub use message::{Operation, Request, Response, ResponseError, ResponseMeta, ResponseStatus};
20
21/// Protocol version supported by this implementation.
22pub const PROTOCOL_VERSION: u16 = 1;
23
24/// Default port for rstmdb server.
25pub const DEFAULT_PORT: u16 = 7401;
26
27/// Maximum frame payload size (16 MiB).
28pub const MAX_PAYLOAD_SIZE: u32 = 16 * 1024 * 1024;