Rircd/src/endpoint.rs

13 lines
285 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 21:33:48 +02:00
use tokio::sync::oneshot;
use std::sync::Arc;
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;
async fn listen(self: Arc<Self>, success_status_send: oneshot::Sender<Result<()>>);
2021-09-16 20:55:05 +02:00
}