pub struct ChannelRegistry { /* private fields */ }Expand description
Thread-safe collection of named channel adapters.
Implementations§
Source§impl ChannelRegistry
impl ChannelRegistry
pub fn new() -> Self
pub fn register( &mut self, adapter: Arc<dyn ChannelAdapter>, ) -> Result<(), ChannelError>
pub fn ids(&self) -> Vec<ChannelId>
pub fn get(&self, id: &ChannelId) -> Option<Arc<dyn ChannelAdapter>>
pub fn listen(&self, id: &ChannelId) -> Result<ChannelStream, ChannelError>
pub fn send( &self, message: OutboundMessage, ) -> ChannelFuture<'_, DeliveryReceipt>
pub fn health(&self, id: &ChannelId) -> ChannelFuture<'_, ChannelHealth>
pub fn dispatch<F, Fut>(
&self,
inbound: InboundMessage,
handler: F,
) -> ChannelFuture<'_, DeliveryReceipt>where
F: FnOnce(InboundMessage) -> Fut + Send + 'static,
Fut: Future<Output = Result<OutboundMessage, ChannelError>> + Send + 'static,
Trait Implementations§
Source§impl Clone for ChannelRegistry
impl Clone for ChannelRegistry
Source§impl Debug for ChannelRegistry
impl Debug for ChannelRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ChannelRegistry
impl !UnwindSafe for ChannelRegistry
impl Freeze for ChannelRegistry
impl Send for ChannelRegistry
impl Sync for ChannelRegistry
impl Unpin for ChannelRegistry
impl UnsafeUnpin for ChannelRegistry
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