pub struct MessagingRegistry<T: Send + Sync + 'static> { /* private fields */ }Expand description
Application-owned registry of messaging adapter factories.
Adapters are registered explicitly by application composition code. Importing an adapter module does not mutate global state or dial external services.
Implementations§
Source§impl<T: Send + Sync + 'static> MessagingRegistry<T>
impl<T: Send + Sync + 'static> MessagingRegistry<T>
Sourcepub fn register_backend(
&mut self,
adapter: impl Into<String>,
factory: Arc<dyn MessagingFactory<T>>,
) -> AppResult<()>
pub fn register_backend( &mut self, adapter: impl Into<String>, factory: Arc<dyn MessagingFactory<T>>, ) -> AppResult<()>
Register a backend factory under adapter.
Sourcepub fn build(&self, config: &BrokerConfig) -> AppResult<MessagingBackend<T>>
pub fn build(&self, config: &BrokerConfig) -> AppResult<MessagingBackend<T>>
Build producer and consumer for BrokerConfig::adapter.
Sourcepub fn producer(
&self,
config: &BrokerConfig,
) -> AppResult<Arc<dyn MessageProducer<T>>>
pub fn producer( &self, config: &BrokerConfig, ) -> AppResult<Arc<dyn MessageProducer<T>>>
Construct a producer for BrokerConfig::adapter.
Sourcepub fn consumer(
&self,
config: &BrokerConfig,
) -> AppResult<Arc<dyn MessageConsumer<T>>>
pub fn consumer( &self, config: &BrokerConfig, ) -> AppResult<Arc<dyn MessageConsumer<T>>>
Construct a consumer for BrokerConfig::adapter.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for MessagingRegistry<T>
impl<T> !UnwindSafe for MessagingRegistry<T>
impl<T> Freeze for MessagingRegistry<T>
impl<T> Send for MessagingRegistry<T>
impl<T> Sync for MessagingRegistry<T>
impl<T> Unpin for MessagingRegistry<T>
impl<T> UnsafeUnpin for MessagingRegistry<T>
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