example_crossplatform_msgda.../src/TelegramEndpoint.rs

35 lines
692 B
Rust

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<Self> {
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<Self>, send_msg: mpsc::Sender<RircdMsg>,
send_event: mpsc::Sender<RircdEvent>) -> Result<()> {
loop {
println!("listen()");
break;
};
Ok(())
}
fn name(&self) -> String {
"Telegram 0x01".into()
}
}