Struct worker::MessageBuilder

source ·
pub struct MessageBuilder<T> { /* private fields */ }

Implementations§

source§

impl<T: Serialize> MessageBuilder<T>

source

pub fn new(message: T) -> Self

Creates a new message builder. The message must be serializable.

source

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

source

pub fn content_type(self, content_type: QueueContentType) -> Self

The content type of the message. Default is QueueContentType::Json.

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V