use std::sync::Arc; use eyre::Result; use crate::endpoint::Endpoint; use async_trait::async_trait; pub struct TelegramEndpoint { } impl TelegramEndpoint { pub fn new() -> Result { Ok( TelegramEndpoint { } ) } } use tokio::sync::mpsc; use crate::msg::RircdMsg; use crate::event::RircdEvent; #[async_trait] impl Endpoint for TelegramEndpoint { async fn listen(self: Arc, send_msg: mpsc::Sender, send_event: mpsc::Sender) -> Result<()> { loop { println!("listen()"); break; }; Ok(()) } fn name(&self) -> String { "Telegram 0x01".into() } }