Rircd/src/endpoint.rs

15 lines
359 B
Rust
Raw Normal View History

2021-09-16 21:33:48 +02:00
use eyre::Result;
2021-09-16 20:55:05 +02:00
use async_trait::async_trait;
2021-09-16 22:40:40 +02:00
use tokio::sync::{mpsc, oneshot};
2021-09-16 21:33:48 +02:00
use std::sync::Arc;
2021-09-16 22:40:40 +02:00
use crate::event::Event;
2021-09-16 20:55:05 +02:00
#[async_trait]
pub trait Endpoint {
fn name(&self) -> String;
2021-09-16 21:33:48 +02:00
fn is_active(&self) -> bool;
2021-09-16 22:40:40 +02:00
async fn listen(self: Arc<Self>, success_status_send: oneshot::Sender<Result<()>>,
event_receiver: mpsc::Sender<Event>);
2021-09-16 20:55:05 +02:00
}