1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use crate::{Channel, Delivery, Result};
/// A message delivered in response to a [`get`](struct.Queue.html#method.get) request.
#[derive(Clone, Debug)]
pub struct Get {
/// The message.
pub delivery: Delivery,
/// The number of messages present in the queue at the time the get was serviced.
pub message_count: u32,
}
impl Get {
/// Calls [`Delivery::ack`](struct.Delivery.html#method.ack) on `self.delivery`.
#[inline]
pub fn ack(self, channel: &Channel) -> Result<()> {
self.delivery.ack(channel)
}
/// Calls [`Delivery::ack_multiple`](struct.Delivery.html#method.ack_multiple) on
/// `self.delivery`.
#[inline]
pub fn ack_multiple(self, channel: &Channel) -> Result<()> {
self.delivery.ack_multiple(channel)
}
/// Calls [`Delivery::nack`](struct.Delivery.html#method.nack) on `self.delivery`.
#[inline]
pub fn nack(self, channel: &Channel, requeue: bool) -> Result<()> {
self.delivery.nack(channel, requeue)
}
/// Calls [`Delivery::nack_multiple`](struct.Delivery.html#method.nack_multiple) on
/// `self.delivery`.
#[inline]
pub fn nack_multiple(self, channel: &Channel, requeue: bool) -> Result<()> {
self.delivery.nack_multiple(channel, requeue)
}
/// Calls [`Delivery::reject`](struct.Delivery.html#method.reject) on `self.delivery`.
#[inline]
pub fn reject(self, channel: &Channel, requeue: bool) -> Result<()> {
self.delivery.reject(channel, requeue)
}
}