Skip to main content

offline_protocol_core/
lib.rs

1//! Core types and data structures for the Offline Protocol SDK.
2//!
3//! This crate provides the fundamental types used throughout the SDK:
4//! - Message types and identifiers
5//! - Protocol types (UserId, AppId, TTL, etc.)
6//! - Error types
7//!
8//! All types in this crate are 100% safe Rust with no unsafe blocks.
9
10#![deny(unsafe_code)]
11#![warn(missing_docs)]
12
13pub mod address;
14pub mod error;
15pub mod message;
16pub mod service;
17pub mod sync;
18pub mod types;
19pub mod username;
20pub mod wire;
21
22pub use address::{Address, AddressError};
23pub use error::{Error, Result};
24pub use message::{
25    ContentType, ForwardInfo, MediaMetadata, Message, MessageId, MessagePriority, ReplyContext,
26    WireCodec,
27};
28pub use service::{ServiceDescriptor, ServiceId};
29pub use sync::{MutexExt, RwLockExt};
30pub use types::{
31    validate_id_chars, AppId, HopCount, IdValidationError, LamportClock, LocalInstant, Timestamp,
32    UserId, WallClockTimestamp, MAX_ID_LEN, TTL,
33};
34pub use username::{contains_control_or_format, Username, UsernameError};
35pub use wire::{WIRE_V1_MAGIC, WIRE_VERSION_V1};