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>where
B: RpcCommBus,
B::InitialPayload: Deserialize<'i> + Serialize,
B::BackPayload: Deserialize<'b> + Serialize,
B::ForthPayload: Deserialize<'f> + Serialize,
impl<'i, 'b, 'f, B> Delivery<B>where
B: RpcCommBus,
B::InitialPayload: Deserialize<'i> + Serialize,
B::BackPayload: Deserialize<'b> + Serialize,
B::ForthPayload: Deserialize<'f> + Serialize,
Sourcepub async fn reply_recv_many(
&self,
back_payload: &B::BackPayload,
rpc_chan: &RpcChannel,
) -> Result<impl Stream<Item = Delivery<ForthReply<B>>>>
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.
Sourcepub async fn reply_recv(
&self,
back_payload: &B::BackPayload,
rpc_chan: &RpcChannel,
) -> Result<impl Future<Output = Delivery<ForthReply<B>>>>
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>where
B: RpcBus,
B::PublishPayload: Deserialize<'p> + Serialize,
B::ReplyPayload: Deserialize<'r> + Serialize,
impl<'p, 'r, B> Delivery<B>where
B: RpcBus,
B::PublishPayload: Deserialize<'p> + Serialize,
B::ReplyPayload: Deserialize<'r> + Serialize,
Source§impl<'p, 'r, B> Delivery<B>
impl<'p, 'r, B> Delivery<B>
Sourcepub fn get_payload(&'p self) -> Result<B::PublishPayload>
pub fn get_payload(&'p self) -> Result<B::PublishPayload>
Deserialize and return the payload from the Delivery
Sourcepub fn get_reply_uuid(&self) -> Option<Result<Uuid>>
pub fn get_reply_uuid(&self) -> Option<Result<Uuid>>
Get the correlation Uuid of the message this message is a reply to
Sourcepub fn routing_key(&self) -> &str
pub fn routing_key(&self) -> &str
Get routing key of this message
Sourcepub fn redelivered(&self) -> bool
pub fn redelivered(&self) -> bool
Get whether this message was redelivered or not
Trait Implementations§
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> 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