Skip to main content

Delivery

Struct Delivery 

Source
pub struct Delivery<'a, T = ()> {
    pub message: &'a Message,
    pub body: T,
    pub delete: bool,
    /* private fields */
}
Expand description

What the handler receives: the whole message, the body (already deserialized in consume_typed; () in consume_with), delete (default true) and Delivery::change_visibility.

Fields§

§message: &'a Message§body: T§delete: bool

true (the default): the message is deleted (ack) if the handler returns Ok. With false, it stays in the queue and becomes visible again at the end of the invisibility.

Implementations§

Source§

impl<T> Delivery<'_, T>

Source

pub fn change_visibility( &self, seconds: u32, ) -> Result<VisibilityResponse, Error>

Changes the invisibility to seconds from now on; the value becomes the renewal’s.

Source

pub fn lease_seconds(&self) -> u32

The seconds the automatic renewal requests on each round.

Source

pub fn lease_lost(&self) -> bool

true if the server refused a renewal (the message already went back to the queue or was deleted).

Auto Trait Implementations§

§

impl<'a, T = ()> !RefUnwindSafe for Delivery<'a, T>

§

impl<'a, T = ()> !UnwindSafe for Delivery<'a, T>

§

impl<'a, T> Freeze for Delivery<'a, T>
where T: Freeze,

§

impl<'a, T> Send for Delivery<'a, T>
where T: Send,

§

impl<'a, T> Sync for Delivery<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Delivery<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for Delivery<'a, T>
where T: UnsafeUnpin,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.