pub struct InProcessBroker<B>(/* private fields */);Expand description
A broker whose connect is its InProcess transition, so the suites that take any
Broker run against the in-process transport.
lifecycle, redelivery_address and the capabilities suites
connect the broker they are handed with Broker::connect, which is what their live pass
needs. Wrapping the production broker in this runs the same suite a second time without a
server: the connected form, and so every descriptor and publish policy, is the production one,
only the transport underneath is the in-process one.
§Examples
use ruststream::conformance::harness::{self, InProcessBroker};
use ruststream::memory::{MemoryBroker, MemorySource};
harness::lifecycle(
|| InProcessBroker::new(MemoryBroker::new()),
|name| MemorySource::new(name),
|connected| connected.publisher(),
)
.await;Implementations§
Source§impl<B> InProcessBroker<B>
impl<B> InProcessBroker<B>
Sourcepub const fn new(broker: B) -> Self
pub const fn new(broker: B) -> Self
Wraps broker, the production broker a service builds its app on.
§Examples
use std::time::Duration;
use ruststream::conformance::harness::InProcessBroker;
use ruststream::conformance::settlement;
use ruststream::memory::{MemoryBroker, MemorySource};
// The settlement suite again, on the production broker's in-process transport.
let broker = MemoryBroker::new();
settlement::suite(
|| InProcessBroker::new(broker.clone()),
|name| MemorySource::new(name),
|connected| connected.publisher(),
Duration::ZERO,
)
.await;Trait Implementations§
Source§impl<B: InProcess> Broker for InProcessBroker<B>
impl<B: InProcess> Broker for InProcessBroker<B>
Source§type Connected = <B as Broker>::Connected
type Connected = <B as Broker>::Connected
The connected form of this broker: the typed witness that
connect
succeeded.Source§impl<B: Clone> Clone for InProcessBroker<B>
impl<B: Clone> Clone for InProcessBroker<B>
Auto Trait Implementations§
impl<B> Freeze for InProcessBroker<B>where
B: Freeze,
impl<B> RefUnwindSafe for InProcessBroker<B>where
B: RefUnwindSafe,
impl<B> Send for InProcessBroker<B>where
B: Send,
impl<B> Sync for InProcessBroker<B>where
B: Sync,
impl<B> Unpin for InProcessBroker<B>where
B: Unpin,
impl<B> UnsafeUnpin for InProcessBroker<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for InProcessBroker<B>where
B: UnwindSafe,
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
Source§impl<B> BrokerRegistration for Bwhere
B: Broker + 'static,
impl<B> BrokerRegistration for Bwhere
B: Broker + 'static,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request