Struct worker::MessageBuilder
source · pub struct MessageBuilder<T> { /* private fields */ }
Implementations§
source§impl<T: Serialize> MessageBuilder<T>
impl<T: Serialize> MessageBuilder<T>
sourcepub fn new(message: T) -> Self
pub fn new(message: T) -> Self
Creates a new message builder. The message must be serializable
.
sourcepub fn delay_seconds(self, delay_seconds: u32) -> Self
pub fn delay_seconds(self, delay_seconds: u32) -> Self
The number of seconds to delay a message for within the queue, before it can be delivered to a consumer
sourcepub fn content_type(self, content_type: QueueContentType) -> Self
pub fn content_type(self, content_type: QueueContentType) -> Self
The content type of the message.
Default is QueueContentType::Json
.
sourcepub fn build(self) -> SendMessage<T>
pub fn build(self) -> SendMessage<T>
Build the message.
Auto Trait Implementations§
impl<T> Freeze for MessageBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for MessageBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for MessageBuilder<T>where
T: Send,
impl<T> Sync for MessageBuilder<T>where
T: Sync,
impl<T> Unpin for MessageBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for MessageBuilder<T>where
T: UnwindSafe,
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