Expand description
Zero-copy deserialization for performance optimization
This module provides zero-copy deserialization capabilities using Cow (Copy-on-Write)
to avoid unnecessary data copying during deserialization. This is particularly useful
for large message bodies where avoiding copies can significantly improve performance.
§Examples
use celers_protocol::zerocopy::{MessageRef, TaskArgsRef};
use uuid::Uuid;
// Create a zero-copy message reference
let task_id = Uuid::new_v4();
let body = b"{\"args\":[1,2],\"kwargs\":{}}";
let msg = MessageRef::new("tasks.add", task_id, body);
assert_eq!(msg.task_name(), "tasks.add");
assert_eq!(msg.task_id(), task_id);Structs§
- Message
Headers Ref - Zero-copy message headers
- Message
Properties Ref - Zero-copy message properties
- Message
Ref - Zero-copy Celery message
- Task
Args Ref - Zero-copy task arguments