pub struct ChannelRegistry { /* private fields */ }Expand description
Registry of channel factories, keyed by channel type name.
Implementations§
Source§impl ChannelRegistry
impl ChannelRegistry
Sourcepub fn register(&mut self, factory: Box<dyn ChannelFactory>)
pub fn register(&mut self, factory: Box<dyn ChannelFactory>)
Register a channel factory.
Sourcepub fn get(&self, channel_type: &str) -> Option<&dyn ChannelFactory>
pub fn get(&self, channel_type: &str) -> Option<&dyn ChannelFactory>
Get a factory by channel type.
Sourcepub fn channel_types(&self) -> Vec<&str>
pub fn channel_types(&self) -> Vec<&str>
List all registered channel types.
Sourcepub fn has_channel(&self, channel_type: &str) -> bool
pub fn has_channel(&self, channel_type: &str) -> bool
Check if a channel type is registered.
Sourcepub fn build_review_from_config(
&self,
route: &ChannelRouteConfig,
) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>
pub fn build_review_from_config( &self, route: &ChannelRouteConfig, ) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>
Build a ReviewChannel from routing config.
Sourcepub fn build_review_from_route(
&self,
route: &ReviewRouteConfig,
strategy: &MultiChannelStrategy,
) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>
pub fn build_review_from_route( &self, route: &ReviewRouteConfig, strategy: &MultiChannelStrategy, ) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>
Build a ReviewChannel from a ReviewRouteConfig (single or multi).
If the config specifies multiple channels, returns a MultiReviewChannel
wrapping all of them. If single, returns the channel directly.
Sourcepub fn build_session_from_config(
&self,
route: &ChannelRouteConfig,
) -> Result<Box<dyn SessionChannel>, SessionChannelError>
pub fn build_session_from_config( &self, route: &ChannelRouteConfig, ) -> Result<Box<dyn SessionChannel>, SessionChannelError>
Build a SessionChannel from routing config.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChannelRegistry
impl !RefUnwindSafe for ChannelRegistry
impl Send for ChannelRegistry
impl Sync for ChannelRegistry
impl Unpin for ChannelRegistry
impl UnsafeUnpin for ChannelRegistry
impl !UnwindSafe 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