-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathlib.rs
More file actions
67 lines (64 loc) · 2.32 KB
/
lib.rs
File metadata and controls
67 lines (64 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//! Wire protocol types and codec for the Iggy binary protocol.
//!
//! This crate is the single source of truth for the binary wire format
//! shared between the Iggy server and SDK. It is a pure codec - no I/O,
//! no async, no runtime dependencies.
//!
//! # Design
//!
//! Protocol types are independent from domain types.
//! Conversion between wire types and domain types happens at the boundary
//! (SDK client impls, server handlers).
//!
//! # Wire frame format
//!
//! **Request** (client -> server):
//! ```text
//! [length:4 bytes, u32 LE][code:4 bytes, u32 LE][payload:N bytes]
//! ```
//!
//! **Response** (server -> client):
//! ```text
//! [status:4 bytes, u32 LE][length:4 bytes, u32 LE][payload:N bytes]
//! ```
//!
//! All multi-byte integers are little-endian. Strings are length-prefixed
//! (u8 length for names, u32 length for longer strings).
pub mod codec;
pub mod codes;
pub mod consensus;
pub mod error;
pub mod frame;
pub mod message_layout;
pub mod message_view;
pub mod primitives;
pub mod requests;
pub mod responses;
pub use codec::{WireDecode, WireEncode};
pub use codes::*;
pub use error::WireError;
pub use frame::*;
pub use message_layout::*;
pub use primitives::consumer::WireConsumer;
pub use primitives::identifier::{MAX_WIRE_NAME_LENGTH, WireIdentifier, WireName};
pub use primitives::partitioning::{MAX_MESSAGES_KEY_LENGTH, WirePartitioning};
pub use primitives::permissions::{
WireGlobalPermissions, WirePermissions, WireStreamPermissions, WireTopicPermissions,
};
pub use primitives::polling_strategy::WirePollingStrategy;