pub struct ChannelBridge { /* private fields */ }Expand description
Manages multiple ChannelAdapters and routes messages between them.
Implementations§
Source§impl ChannelBridge
impl ChannelBridge
Sourcepub async fn register(&self, adapter: Arc<dyn ChannelAdapter>)
pub async fn register(&self, adapter: Arc<dyn ChannelAdapter>)
Register an adapter with the bridge.
Sourcepub async fn start_all(&self) -> PunchResult<()>
pub async fn start_all(&self) -> PunchResult<()>
Start all registered adapters.
Sourcepub async fn stop_all(&self) -> PunchResult<()>
pub async fn stop_all(&self) -> PunchResult<()>
Stop all registered adapters.
Sourcepub async fn send_message(
&self,
adapter_name: &str,
channel_id: &str,
text: &str,
) -> PunchResult<()>
pub async fn send_message( &self, adapter_name: &str, channel_id: &str, text: &str, ) -> PunchResult<()>
Send a message through a specific adapter by name.
Sourcepub async fn list_adapters(&self) -> Vec<String>
pub async fn list_adapters(&self) -> Vec<String>
List the names of all registered adapters.
Sourcepub async fn adapter_statuses(
&self,
) -> Vec<(String, ChannelPlatform, ChannelStatus)>
pub async fn adapter_statuses( &self, ) -> Vec<(String, ChannelPlatform, ChannelStatus)>
Get the status of all adapters.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChannelBridge
impl !RefUnwindSafe for ChannelBridge
impl Send for ChannelBridge
impl Sync for ChannelBridge
impl Unpin for ChannelBridge
impl UnsafeUnpin for ChannelBridge
impl !UnwindSafe for ChannelBridge
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