pub struct ConnectedLapinTestBroker { /* private fields */ }Expand description
The connected form of LapinTestBroker.
Routes published messages to subscribers by exact queue name (the default-exchange model) and
implements TestableBroker, so it drives both the
TestApp harness and the framework’s conformance suite in
process. Clones share one router, so a publisher and a subscriber taken from the same broker
see each other.
Implementations§
Source§impl ConnectedLapinTestBroker
impl ConnectedLapinTestBroker
Sourcepub async fn subscribe(
&self,
queue: impl Into<String>,
) -> Result<LapinTestSubscriber, AmqpError>
pub async fn subscribe( &self, queue: impl Into<String>, ) -> Result<LapinTestSubscriber, AmqpError>
Subscribes to queue (exact-name routing, the default-exchange model).
§Errors
Returns AmqpError::InvalidOptions when queue is empty and AmqpError::Closed
once the transport has shut down.
Sourcepub fn publisher(&self, policy: LapinTestPublish) -> LapinTestPublisher
pub fn publisher(&self, policy: LapinTestPublish) -> LapinTestPublisher
A live publisher into this broker’s router, mirroring
ConnectedLapinBroker::publisher. The
in-process transport routes by queue name only, so it has a single policy.
Trait Implementations§
Source§impl Clone for ConnectedLapinTestBroker
impl Clone for ConnectedLapinTestBroker
Source§fn clone(&self) -> ConnectedLapinTestBroker
fn clone(&self) -> ConnectedLapinTestBroker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectedLapinTestBroker
impl Debug for ConnectedLapinTestBroker
Source§impl DefaultPublish for ConnectedLapinTestBroker
impl DefaultPublish for ConnectedLapinTestBroker
Source§type Policy = LapinTestPublish
type Policy = LapinTestPublish
The broker’s plain publish policy, constructible with its defaults.
Source§impl PublishPolicy<ConnectedLapinTestBroker> for LapinTestPublish
impl PublishPolicy<ConnectedLapinTestBroker> for LapinTestPublish
Source§type Live = LapinTestPublisher
type Live = LapinTestPublisher
The live form this policy pairs into: a
Publisher for a leaf policy, or the live
wiring form for a combinator stack (a typed publisher over a policy pairs into the same
typed publisher over the live leaf).Source§impl Subscribe for ConnectedLapinTestBroker
impl Subscribe for ConnectedLapinTestBroker
Source§type Subscriber = LapinTestSubscriber
type Subscriber = LapinTestSubscriber
The subscriber type opened by a by-name subscription.
Source§impl SubscriptionSource<ConnectedLapinTestBroker> for RabbitQueue
Available on crate feature testing only.
impl SubscriptionSource<ConnectedLapinTestBroker> for RabbitQueue
Available on crate feature
testing only.Source§type Subscriber = LapinTestSubscriber
type Subscriber = LapinTestSubscriber
The subscriber type this source opens.
Source§async fn subscribe(
self,
connected: &ConnectedLapinTestBroker,
) -> Result<Self::Subscriber, AmqpError>
async fn subscribe( self, connected: &ConnectedLapinTestBroker, ) -> Result<Self::Subscriber, AmqpError>
Opens the subscription against the connected broker. Called once at startup. Read more
Source§impl TestableBroker for ConnectedLapinTestBroker
impl TestableBroker for ConnectedLapinTestBroker
Source§fn install_coordinator(&self, coordinator: Coordinator)
fn install_coordinator(&self, coordinator: Coordinator)
Installs the harness coordinator into this broker’s bus for a test run. Idempotent: a second
install on the same broker is ignored.
Source§fn inject(&self, message: OutgoingMessage<'_>)
fn inject(&self, message: OutgoingMessage<'_>)
Injects a message onto the bus as an external producer would, synchronously (no awaiting).
Routes through the broker’s normal fanout, so it is recorded and counted like any publish.
Source§fn published(&self, name: &str) -> Vec<RawMessage>
fn published(&self, name: &str) -> Vec<RawMessage>
Returns every message published to
name on this broker, in publish order. Backs the
harness’s published::<T>(name) assertions and expect_published.Auto Trait Implementations§
impl Freeze for ConnectedLapinTestBroker
impl RefUnwindSafe for ConnectedLapinTestBroker
impl Send for ConnectedLapinTestBroker
impl Sync for ConnectedLapinTestBroker
impl Unpin for ConnectedLapinTestBroker
impl UnsafeUnpin for ConnectedLapinTestBroker
impl UnwindSafe for ConnectedLapinTestBroker
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
Mutably borrows from an owned value. Read more