Delivery

Struct Delivery 

Source
pub struct Delivery<B> { /* private fields */ }
Expand description

A message that contains a payload associated with a bus

Implementations§

Source§

impl<'i, 'b, 'f, B> Delivery<B>

Source

pub async fn reply_recv_many( &self, back_payload: &B::BackPayload, rpc_chan: &RpcChannel, ) -> Result<impl Stream<Item = Delivery<ForthReply<B>>>>

Reply to a message that was sent by the receiver of the initial message and await multiple replies from the receiver. The messages can be obtained by calling futures::StreamExt::next on the returned Stream.

Source

pub async fn reply_recv( &self, back_payload: &B::BackPayload, rpc_chan: &RpcChannel, ) -> Result<impl Future<Output = Delivery<ForthReply<B>>>>

Reply to a message that was sent by the receiver of the initial message and await one reply from the receiver. The message can be obtained by awaiting the returned Future.

Source§

impl<'p, 'r, B> Delivery<B>

Source

pub async fn reply( &self, reply_payload: &B::ReplyPayload, chan: &impl Channel, ) -> Result<()>

Reply to a Delivery.

Source§

impl<'p, 'r, B> Delivery<B>

Source

pub fn get_payload(&'p self) -> Result<B::PublishPayload>

Deserialize and return the payload from the Delivery

Source

pub fn get_uuid(&self) -> Option<Result<Uuid>>

Get the message correlation Uuid

Source

pub fn get_reply_uuid(&self) -> Option<Result<Uuid>>

Get the correlation Uuid of the message this message is a reply to

Source

pub fn routing_key(&self) -> &str

Get routing key of this message

Source

pub async fn ack(&self, multiple: bool) -> Result<()>

Ack the message

Source

pub fn redelivered(&self) -> bool

Get whether this message was redelivered or not

Source

pub async fn nack(&self, multiple: bool, requeue: bool) -> Result<()>

Nack the message

Trait Implementations§

Source§

impl<B: Debug> Debug for Delivery<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B> From<Delivery> for Delivery<B>

Source§

fn from(delivery: Delivery) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<B> Freeze for Delivery<B>

§

impl<B> !RefUnwindSafe for Delivery<B>

§

impl<B> Send for Delivery<B>
where B: Send,

§

impl<B> Sync for Delivery<B>
where B: Sync,

§

impl<B> Unpin for Delivery<B>
where B: Unpin,

§

impl<B> !UnwindSafe for Delivery<B>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = 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>,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,