pub struct ConnectedMemoryBroker<Log = Discarding> { /* private fields */ }Expand description
The connected form of MemoryBroker: the typed witness that Broker::connect ran.
Cheap to clone: the in-memory bus is shared state by nature, so the connected form is a
shareable handle on it, exactly like the unconnected broker. Subscriptions (the
Subscribe capability, MemorySource) resolve against this form, and carry over the
broker’s log mode: only a Retaining one opens repositionable subscriptions.
Implementations§
Source§impl<Log: LogMode> ConnectedMemoryBroker<Log>
impl<Log: LogMode> ConnectedMemoryBroker<Log>
Sourcepub fn publisher(&self) -> MemoryPublisher
pub fn publisher(&self) -> MemoryPublisher
Returns a publisher bound to this broker.
Sourcepub fn requester(&self) -> MemoryRequester
pub fn requester(&self) -> MemoryRequester
Returns a request / reply-capable publisher bound to this broker.
See MemoryBroker::requester for why its operations report RequestError rather
than MemoryError.
Trait Implementations§
Source§impl<Log> Clone for ConnectedMemoryBroker<Log>
impl<Log> Clone for ConnectedMemoryBroker<Log>
Source§impl<Log: LogMode> ConnectedBroker for ConnectedMemoryBroker<Log>
impl<Log: LogMode> ConnectedBroker for ConnectedMemoryBroker<Log>
Source§fn shutdown(self) -> impl Future<Output = Result<Self::Closed, Self::Error>>
fn shutdown(self) -> impl Future<Output = Result<Self::Closed, Self::Error>>
Enters the terminal shut-down state: the bus itself flips to its ShutDown variant, so
every aliased handle that would touch it (a publisher’s publish or transaction commit, a
request) errors with MemoryError::ShutDown. Consuming self makes any further use
of this handle a compile error; the returned witness reports how many subscriber
registrations the teardown dropped.
Source§type Error = MemoryError
type Error = MemoryError
Source§impl<Log> Debug for ConnectedMemoryBroker<Log>
impl<Log> Debug for ConnectedMemoryBroker<Log>
Source§impl<Log: LogMode> DefaultPublish for ConnectedMemoryBroker<Log>
impl<Log: LogMode> DefaultPublish for ConnectedMemoryBroker<Log>
Source§type Policy = MemoryPublish
type Policy = MemoryPublish
Source§impl<Log: LogMode> PublishPolicy<ConnectedMemoryBroker<Log>> for MemoryPublish
impl<Log: LogMode> PublishPolicy<ConnectedMemoryBroker<Log>> for MemoryPublish
Source§type Live = MemoryPublisher
type Live = MemoryPublisher
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§fn pair(
self,
connected: &ConnectedMemoryBroker<Log>,
) -> impl Future<Output = Result<Self::Live, PairError>>
fn pair( self, connected: &ConnectedMemoryBroker<Log>, ) -> impl Future<Output = Result<Self::Live, PairError>>
Source§fn channel_bindings(&self, channel: &str) -> Bindings
fn channel_bindings(&self, channel: &str) -> Bindings
AsyncAPI
document. Read moreSource§fn operation_bindings(&self, channel: &str) -> Bindings
fn operation_bindings(&self, channel: &str) -> Bindings
send operation in the document. Read moreSource§impl<Log: LogMode> PublishPolicy<ConnectedMemoryBroker<Log>> for MemoryRequest
impl<Log: LogMode> PublishPolicy<ConnectedMemoryBroker<Log>> for MemoryRequest
Source§type Live = MemoryRequester
type Live = MemoryRequester
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§fn pair(
self,
connected: &ConnectedMemoryBroker<Log>,
) -> impl Future<Output = Result<Self::Live, PairError>>
fn pair( self, connected: &ConnectedMemoryBroker<Log>, ) -> impl Future<Output = Result<Self::Live, PairError>>
Source§fn channel_bindings(&self, channel: &str) -> Bindings
fn channel_bindings(&self, channel: &str) -> Bindings
AsyncAPI
document. Read moreSource§fn operation_bindings(&self, channel: &str) -> Bindings
fn operation_bindings(&self, channel: &str) -> Bindings
send operation in the document. Read moreSource§impl<Log: LogMode> RedeliveryAddressed<ConnectedMemoryBroker<Log>> for MemoryPattern
impl<Log: LogMode> RedeliveryAddressed<ConnectedMemoryBroker<Log>> for MemoryPattern
Source§fn redelivery_address(
&self,
_connected: &ConnectedMemoryBroker<Log>,
) -> impl Future<Output = Result<RedeliveryAddress, MemoryError>> + Send
fn redelivery_address( &self, _connected: &ConnectedMemoryBroker<Log>, ) -> impl Future<Output = Result<RedeliveryAddress, MemoryError>> + Send
The pattern text. A publish to it matches the pattern token for token (* matches the
token *, > the token >), so under Routing::EveryMatch it reaches this
subscription.
Source§impl<Log: LogMode> RedeliveryAddressed<ConnectedMemoryBroker<Log>> for MemorySource
impl<Log: LogMode> RedeliveryAddressed<ConnectedMemoryBroker<Log>> for MemorySource
Source§fn redelivery_address(
&self,
_connected: &ConnectedMemoryBroker<Log>,
) -> impl Future<Output = Result<RedeliveryAddress, MemoryError>> + Send
fn redelivery_address( &self, _connected: &ConnectedMemoryBroker<Log>, ) -> impl Future<Output = Result<RedeliveryAddress, MemoryError>> + Send
Source§impl<Log: LogMode> Subscribe for ConnectedMemoryBroker<Log>
impl<Log: LogMode> Subscribe for ConnectedMemoryBroker<Log>
Source§fn subscribe(
&self,
name: &str,
) -> impl Future<Output = Result<Self::Subscriber, Self::Error>>
fn subscribe( &self, name: &str, ) -> impl Future<Output = Result<Self::Subscriber, Self::Error>>
A name with a wildcard token is refused with MemoryError::WildcardName: this form
reads one name, and MemoryPattern is the one that reads a pattern.
Source§type Subscriber = MemorySubscriber<Log>
type Subscriber = MemorySubscriber<Log>
Source§type Copies = AddressedCopies
type Copies = AddressedCopies
Source§fn declare_retry(
&self,
name: &str,
declaration: &RetryDeclaration,
) -> Result<(), DeclareRetryError>
fn declare_retry( &self, name: &str, declaration: &RetryDeclaration, ) -> Result<(), DeclareRetryError>
Source§impl<Log: LogMode> SubscriptionSource<ConnectedMemoryBroker<Log>> for MemoryPattern
impl<Log: LogMode> SubscriptionSource<ConnectedMemoryBroker<Log>> for MemoryPattern
Source§type Subscriber = MemorySubscriber
type Subscriber = MemorySubscriber
Source§type Copies = AddressedCopies
type Copies = AddressedCopies
AddressedCopies, NamedCopies or BrokerMoves. Read moreSource§fn subscribe(
self,
connected: &ConnectedMemoryBroker<Log>,
) -> impl Future<Output = Result<Self::Subscriber, MemoryError>> + Send
fn subscribe( self, connected: &ConnectedMemoryBroker<Log>, ) -> impl Future<Output = Result<Self::Subscriber, MemoryError>> + Send
Source§fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
Source§fn declare_retry_on(
&self,
connected: &C,
declaration: &RetryDeclaration,
) -> Result<(), DeclareRetryError>
fn declare_retry_on( &self, connected: &C, declaration: &RetryDeclaration, ) -> Result<(), DeclareRetryError>
Source§fn channel_bindings(&self) -> Bindings
fn channel_bindings(&self) -> Bindings
AsyncAPI document. Read moreSource§fn operation_bindings(&self) -> Bindings
fn operation_bindings(&self) -> Bindings
receive operation in the document. Read moreSource§fn message_bindings(&self) -> Bindings
fn message_bindings(&self) -> Bindings
Source§impl<Log: LogMode> SubscriptionSource<ConnectedMemoryBroker<Log>> for MemorySource
impl<Log: LogMode> SubscriptionSource<ConnectedMemoryBroker<Log>> for MemorySource
Source§type Subscriber = MemorySubscriber<Log>
type Subscriber = MemorySubscriber<Log>
Source§type Copies = AddressedCopies
type Copies = AddressedCopies
AddressedCopies, NamedCopies or BrokerMoves. Read moreSource§async fn subscribe(
self,
connected: &ConnectedMemoryBroker<Log>,
) -> Result<Self::Subscriber, MemoryError>
async fn subscribe( self, connected: &ConnectedMemoryBroker<Log>, ) -> Result<Self::Subscriber, MemoryError>
Source§fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
Source§fn declare_retry_on(
&self,
connected: &C,
declaration: &RetryDeclaration,
) -> Result<(), DeclareRetryError>
fn declare_retry_on( &self, connected: &C, declaration: &RetryDeclaration, ) -> Result<(), DeclareRetryError>
Source§fn channel_bindings(&self) -> Bindings
fn channel_bindings(&self) -> Bindings
AsyncAPI document. Read moreSource§fn operation_bindings(&self) -> Bindings
fn operation_bindings(&self) -> Bindings
receive operation in the document. Read moreSource§fn message_bindings(&self) -> Bindings
fn message_bindings(&self) -> Bindings
Source§impl<Log: LogMode> TestableBroker for ConnectedMemoryBroker<Log>
Available on crate feature testing only.
impl<Log: LogMode> TestableBroker for ConnectedMemoryBroker<Log>
testing only.Source§fn published(&self, name: &str) -> Vec<RawMessage>
fn published(&self, name: &str) -> Vec<RawMessage>
What the broker holds under name: everything published there on a discarding broker
(which records for the length of a harness run), and the retained window on a retaining
one, so an assertion never claims more than the broker keeps.
Source§fn routes(&self, destination: &str, subscriptions: &[&str]) -> Vec<usize>
fn routes(&self, destination: &str, subscriptions: &[&str]) -> Vec<usize>
The broker’s own rule, read from the Routing it was built with: a name with a
wildcard token is a MemoryPattern subscription, every other one an exact name.
Source§fn backlog(&self) -> Backlog
fn backlog(&self) -> Backlog
A subscription receives what is published after it opens, on either log mode: a retaining broker keeps its log for a seek to replay, not for a subscription to start from.
Source§fn install_coordinator(&self, coordinator: Coordinator)
fn install_coordinator(&self, coordinator: Coordinator)
Source§fn inject(&self, message: OutgoingMessage<'_>)
fn inject(&self, message: OutgoingMessage<'_>)
Auto Trait Implementations§
impl<Log> Freeze for ConnectedMemoryBroker<Log>where
PhantomData<Log>: Freeze,
impl<Log> RefUnwindSafe for ConnectedMemoryBroker<Log>where
PhantomData<Log>: RefUnwindSafe,
impl<Log> Send for ConnectedMemoryBroker<Log>where
PhantomData<Log>: Send,
impl<Log> Sync for ConnectedMemoryBroker<Log>where
PhantomData<Log>: Sync,
impl<Log> Unpin for ConnectedMemoryBroker<Log>where
PhantomData<Log>: Unpin,
impl<Log> UnsafeUnpin for ConnectedMemoryBroker<Log>where
PhantomData<Log>: UnsafeUnpin,
impl<Log> UnwindSafe for ConnectedMemoryBroker<Log>where
PhantomData<Log>: 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
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> ⓘ
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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request