15 lines
368 B
Rust
15 lines
368 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>, event_sender: oneshot::Sender<Result<mpsc::Sender<Event>>>,
|
|
event_handler: mpsc::Sender<Event>);
|
|
}
|