pub struct MessageBuilder { /* private fields */ }Expand description
Fluent builder for creating Celery messages
Implementations§
Source§impl MessageBuilder
impl MessageBuilder
Sourcepub fn new(task: impl Into<String>) -> Self
pub fn new(task: impl Into<String>) -> Self
Create a new message builder with the given task name
Sourcepub fn routing_key(self, key: impl Into<String>) -> Self
pub fn routing_key(self, key: impl Into<String>) -> Self
Set the routing key
Sourcepub fn expires_in(self, duration: Duration) -> Self
pub fn expires_in(self, duration: Duration) -> Self
Set expiration as duration from now
Sourcepub fn max_retries(self, max: u32) -> Self
pub fn max_retries(self, max: u32) -> Self
Set maximum retries
Sourcepub fn link_signature(self, callback: CallbackSignature) -> Self
pub fn link_signature(self, callback: CallbackSignature) -> Self
Add a success callback with full signature
Sourcepub fn link_error(self, task: impl Into<String>) -> Self
pub fn link_error(self, task: impl Into<String>) -> Self
Add an error callback (errback)
Sourcepub fn link_error_signature(self, errback: CallbackSignature) -> Self
pub fn link_error_signature(self, errback: CallbackSignature) -> Self
Add an error callback with full signature
Sourcepub fn chain_task(self, task: impl Into<String>) -> Self
pub fn chain_task(self, task: impl Into<String>) -> Self
Add a chain task
Sourcepub fn content_type(self, ct: ContentType) -> Self
pub fn content_type(self, ct: ContentType) -> Self
Set content type
Sourcepub fn persistent(self, persistent: bool) -> Self
pub fn persistent(self, persistent: bool) -> Self
Set message persistence
Sourcepub fn build(self) -> BuilderResult<Message>
pub fn build(self) -> BuilderResult<Message>
Build the message
Sourcepub fn build_validated(self) -> BuilderResult<Message>
pub fn build_validated(self) -> BuilderResult<Message>
Build and validate the message
Trait Implementations§
Source§impl Clone for MessageBuilder
impl Clone for MessageBuilder
Source§fn clone(&self) -> MessageBuilder
fn clone(&self) -> MessageBuilder
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 moreAuto Trait Implementations§
impl Freeze for MessageBuilder
impl RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnwindSafe for MessageBuilder
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