pub struct RedisTestClient { /* private fields */ }Expand description
Driver around a single RedisTestBroker instance.
RedisTestClient::start() constructs a fresh, isolated broker. Use it as the entry point in the
ruststream::conformance harness and in handler integration tests.
Trait Implementations§
Source§impl Debug for RedisTestClient
impl Debug for RedisTestClient
Source§impl TestClient for RedisTestClient
impl TestClient for RedisTestClient
Source§type Broker = RedisTestBroker
type Broker = RedisTestBroker
The broker type this test client emulates.
Source§type Subscriber = RedisTestSubscriber
type Subscriber = RedisTestSubscriber
The subscriber type opened by
subscribe.Source§type Publisher = RedisTestPublisher
type Publisher = RedisTestPublisher
The publisher type returned by
publisher.Source§type Error = RedisError
type Error = RedisError
The error type returned by test-client operations.
Source§async fn start() -> Result<Self, Self::Error>
async fn start() -> Result<Self, Self::Error>
Starts a fresh in-memory broker instance. Read more
Source§fn broker(&self) -> &Self::Broker
fn broker(&self) -> &Self::Broker
Returns a handle to the in-memory broker, suitable for registering with a
RustStream.Source§async fn publish(&self, topic: &str, payload: &[u8]) -> Result<(), Self::Error>
async fn publish(&self, topic: &str, payload: &[u8]) -> Result<(), Self::Error>
Publishes a message to the in-memory broker as if from an external producer. Read more
Source§async fn subscribe(
&self,
topic: &str,
) -> Result<RedisTestSubscriber, Self::Error>
async fn subscribe( &self, topic: &str, ) -> Result<RedisTestSubscriber, Self::Error>
Opens a subscription against the in-memory broker. Used by integration tests that need
to verify handler-level behaviour like ack / nack and redelivery. Read more
Source§async fn publisher(&self) -> Result<Self::Publisher, Self::Error>
async fn publisher(&self) -> Result<Self::Publisher, Self::Error>
Returns a publisher bound to the in-memory broker. Useful when the test needs to set
headers or publish in a tight loop without allocating per-call closures. Read more
Auto Trait Implementations§
impl Freeze for RedisTestClient
impl RefUnwindSafe for RedisTestClient
impl Send for RedisTestClient
impl Sync for RedisTestClient
impl Unpin for RedisTestClient
impl UnsafeUnpin for RedisTestClient
impl UnwindSafe for RedisTestClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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 more