pub struct LapinRequester { /* private fields */ }Expand description
The live request/reply client over RabbitMQ direct reply-to.
request publishes to the routing key named by
OutgoingMessage::name (on the default exchange unless the policy’s
exchange says otherwise) with reply-to set to the direct
reply-to pseudo-queue and a generated correlation-id; the responder replies by publishing
to the reply-to it received, echoing the correlation-id.
Direct reply-to is at-most-once: replies live in channel state on one broker node, so a dropped requester channel loses in-flight replies. The per-request timeout is the recovery mechanism.
Obtained by pairing LapinRequest with a connected broker
(ConnectedLapinBroker::requester). Clones share
the reply consumer and the pending-request table; like every live handle it aliases the
connection and reports AmqpError::Closed once the broker has shut down.
Trait Implementations§
Source§impl Clone for LapinRequester
impl Clone for LapinRequester
Source§impl Debug for LapinRequester
impl Debug for LapinRequester
Source§impl Publisher for LapinRequester
impl Publisher for LapinRequester
Source§type Payload = Lend
type Payload = Lend
basic_publish takes the payload as &[u8] and copies it into the frame it sends, so
this publisher reads the bytes and keeps nothing.
Source§async fn publish(
&self,
msg: OutgoingMessage<'_>,
options: Option<&Self::Options>,
) -> Result<(), Self::Error>
async fn publish( &self, msg: OutgoingMessage<'_>, options: Option<&Self::Options>, ) -> Result<(), Self::Error>
Publishes msg on the requester channel without expecting a reply.
The AMQP basic properties are options resolved over the policy’s defaults.
§Errors
Returns AmqpError::Closed once the broker has shut down and AmqpError::Publish
when the channel rejects the frame.
§Cancel safety
Not cancel safe: dropping the future may leave the message published or not.
Source§type Options = LapinPublishOptions
type Options = LapinPublishOptions
QoS, a priority, an ordering key, whatever this
transport lets one message differ from the next in. Read moreSource§impl RequestReply for LapinRequester
impl RequestReply for LapinRequester
Source§async fn request(
&self,
msg: OutgoingMessage<'_>,
timeout: Duration,
) -> Result<Self::Reply, Self::Error>
async fn request( &self, msg: OutgoingMessage<'_>, timeout: Duration, ) -> Result<Self::Reply, Self::Error>
Sends msg and awaits the correlated reply.
§Errors
Returns AmqpError::RequestTimeout when no reply arrives within timeout,
AmqpError::Closed once the broker has shut down, and AmqpError::Request /
AmqpError::Publish on channel failures.
§Cancel safety
Cancel safe for the caller’s state: dropping the future abandons the pending slot and a late reply is discarded. The request itself may still have been published.
Source§type Reply = LapinMessage
type Reply = LapinMessage
Auto Trait Implementations§
impl !RefUnwindSafe for LapinRequester
impl !UnwindSafe for LapinRequester
impl Freeze for LapinRequester
impl Send for LapinRequester
impl Sync for LapinRequester
impl Unpin for LapinRequester
impl UnsafeUnpin for LapinRequester
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> PublishExt for P
impl<P> PublishExt for P
Source§fn message<'a, T>(
&'a self,
value: &'a T,
) -> PublishBuilder<&'a Self, MessageBody<'a, T>, UnnamedCodec, HeadersUnset, <T as OutgoingDestination>::Form>where
T: OutgoingDestination,
fn message<'a, T>(
&'a self,
value: &'a T,
) -> PublishBuilder<&'a Self, MessageBody<'a, T>, UnnamedCodec, HeadersUnset, <T as OutgoingDestination>::Form>where
T: OutgoingDestination,
#[derive(Outgoing)] value, encoded with the crate’s
default codec (name another one with with_codec(..)). A
Serialized value’s bytes leave as they are instead - the wire is
the type’s own (MessageWire), and no codec runs on it. Read moreSource§fn begin(
&self,
) -> impl Future<Output = Result<TransactionScope<'_, Self, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + TransactionalPublisher,
fn begin(
&self,
) -> impl Future<Output = Result<TransactionScope<'_, Self, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + TransactionalPublisher,
TransactionScope that
owns it. Read moreSource§fn owned_transaction(
&self,
) -> impl Future<Output = Result<TypedTransaction<Self::Transaction, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + OwnedTransactions,
fn owned_transaction(
&self,
) -> impl Future<Output = Result<TypedTransaction<Self::Transaction, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + OwnedTransactions,
TypedTransaction that owns it. Read more