celers_protocol/lib.rs
1//! Celery Protocol v2/v5 implementation
2//!
3//! This crate provides the core protocol definitions for Celery message format,
4//! ensuring compatibility with Python Celery workers.
5//!
6//! # Protocol Compatibility
7//!
8//! - Celery Protocol v2 (Celery 4.x+)
9//! - Celery Protocol v5 (Celery 5.x+)
10//!
11//! # Message Format
12//!
13//! Messages consist of:
14//! - **Headers**: Task metadata (task name, ID, parent/root IDs, etc.)
15//! - **Properties**: AMQP properties (`correlation_id`, `reply_to`, `delivery_mode`)
16//! - **Body**: Serialized task arguments
17//! - **Content-Type**: Serialization format ("application/json", "application/x-msgpack")
18//! - **Content-Encoding**: Encoding format ("utf-8", "binary")
19//!
20//! # Modules
21//!
22//! - [`compat`] - Python Celery compatibility verification
23//! - [`serializer`] - Pluggable serialization framework
24//! - [`result`] - Task result message format
25//! - [`event`] - Celery event message format
26//! - [`compression`] - Message body compression
27//! - [`embed`] - Embedded body format (args, kwargs, embed)
28//! - [`negotiation`] - Protocol version negotiation
29//! - [`security`] - Security utilities and content-type whitelist
30//! - [`builder`] - Fluent message builder API
31//! - [`auth`] - Message authentication and signing (HMAC)
32//! - [`crypto`] - Message encryption (AES-256-GCM)
33//! - [`extensions`] - Message extensions and utility helpers
34//! - [`migration`] - Protocol version migration helpers
35//! - [`middleware`] - Message transformation middleware
36//! - [`zerocopy`] - Zero-copy deserialization for performance
37//! - [`lazy`] - Lazy deserialization for large messages
38//! - [`pool`] - Message pooling for memory efficiency
39//! - [`extension_api`] - Custom protocol extensions API
40//! - [`utils`] - Message utility helpers
41//! - [`batch`] - Batch message processing utilities
42//! - [`routing`] - Message routing helpers
43//! - [`retry`] - Retry strategy utilities
44//! - [`dedup`] - Message deduplication utilities
45//! - [`priority_queue`] - Priority-based message queues
46//! - [`workflow`] - Workflow and task chain utilities
47
48pub mod auth;
49pub mod batch;
50pub mod builder;
51pub mod compat;
52pub mod compression;
53pub mod crypto;
54pub mod dedup;
55pub mod embed;
56pub mod event;
57pub mod extension_api;
58pub mod extensions;
59pub mod lazy;
60mod message;
61pub mod middleware;
62pub mod migration;
63pub mod negotiation;
64pub mod pool;
65pub mod priority_queue;
66pub mod result;
67pub mod retry;
68pub mod routing;
69pub mod security;
70pub mod serializer;
71mod types;
72pub mod utils;
73pub mod workflow;
74pub mod zerocopy;
75
76#[cfg(test)]
77mod tests;
78
79pub use types::*;
80
81// Re-export pub(crate) constants so they remain accessible at `crate::` path
82pub(crate) use types::{CONTENT_TYPE_JSON, DEFAULT_LANG, ENCODING_UTF8};