pub struct MessageHeaders {
pub task: String,
pub id: Uuid,
pub lang: String,
pub root_id: Option<Uuid>,
pub parent_id: Option<Uuid>,
pub group: Option<Uuid>,
pub retries: Option<u32>,
pub eta: Option<DateTime<Utc>>,
pub expires: Option<DateTime<Utc>>,
pub extra: HashMap<String, Value>,
}Expand description
Message headers (Celery protocol)
Fields§
§task: StringTask name (e.g., “tasks.add”)
id: UuidTask ID (UUID)
lang: StringProgramming language (“rust”, “py”)
root_id: Option<Uuid>Root task ID (for workflow tracking)
parent_id: Option<Uuid>Parent task ID (for nested tasks)
group: Option<Uuid>Group ID (for grouped tasks)
retries: Option<u32>Maximum retries
eta: Option<DateTime<Utc>>ETA (Estimated Time of Arrival) for delayed tasks
expires: Option<DateTime<Utc>>Task expiration timestamp
extra: HashMap<String, Value>Additional custom headers
Implementations§
Source§impl MessageHeaders
impl MessageHeaders
pub fn new(task: String, id: Uuid) -> Self
Sourcepub fn with_root_id(self, root_id: Uuid) -> Self
pub fn with_root_id(self, root_id: Uuid) -> Self
Set the root ID field (builder pattern)
Sourcepub fn with_parent_id(self, parent_id: Uuid) -> Self
pub fn with_parent_id(self, parent_id: Uuid) -> Self
Set the parent ID field (builder pattern)
Sourcepub fn with_group(self, group: Uuid) -> Self
pub fn with_group(self, group: Uuid) -> Self
Set the group field (builder pattern)
Sourcepub fn with_retries(self, retries: u32) -> Self
pub fn with_retries(self, retries: u32) -> Self
Set the retries field (builder pattern)
Sourcepub fn with_expires(self, expires: DateTime<Utc>) -> Self
pub fn with_expires(self, expires: DateTime<Utc>) -> Self
Set the expires field (builder pattern)
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validate message headers
Trait Implementations§
Source§impl Clone for MessageHeaders
impl Clone for MessageHeaders
Source§fn clone(&self) -> MessageHeaders
fn clone(&self) -> MessageHeaders
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageHeaders
impl Debug for MessageHeaders
Source§impl<'de> Deserialize<'de> for MessageHeaders
impl<'de> Deserialize<'de> for MessageHeaders
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MessageHeaders
impl PartialEq for MessageHeaders
Source§impl Serialize for MessageHeaders
impl Serialize for MessageHeaders
impl Eq for MessageHeaders
impl StructuralPartialEq for MessageHeaders
Auto Trait Implementations§
impl Freeze for MessageHeaders
impl RefUnwindSafe for MessageHeaders
impl Send for MessageHeaders
impl Sync for MessageHeaders
impl Unpin for MessageHeaders
impl UnwindSafe for MessageHeaders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more