Rircd/src/endpoint.rs

15 lines
359 B
Rust

use eyre::Result;
use async_trait::async_trait;
use tokio::sync::{mpsc, oneshot};
use std::sync::Arc;
use crate::event::Event;
#[async_trait]
pub trait Endpoint {
fn name(&self) -> String;
fn is_active(&self) -> bool;
async fn listen(self: Arc<Self>, success_status_send: oneshot::Sender<Result<()>>,
event_receiver: mpsc::Sender<Event>);
}