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: booltrue (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>
impl<T> Delivery<'_, T>
Sourcepub fn change_visibility(
&self,
seconds: u32,
) -> Result<VisibilityResponse, Error>
pub fn change_visibility( &self, seconds: u32, ) -> Result<VisibilityResponse, Error>
Changes the invisibility to seconds from now on; the value becomes the renewal’s.
Sourcepub fn lease_seconds(&self) -> u32
pub fn lease_seconds(&self) -> u32
The seconds the automatic renewal requests on each round.
Sourcepub fn lease_lost(&self) -> bool
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> 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