lavina/crates/projection-irc/src/handler.rs

19 lines
491 B
Rust
Raw Normal View History

use lavina_core::{player::PlayerConnection, prelude::Str, LavinaCore};
use std::future::Future;
use tokio::io::AsyncWrite;
pub struct IrcConnection<'a, T: AsyncWrite + Unpin> {
pub server_name: Str,
/// client is nick of requester
pub client: Str,
pub writer: &'a mut T,
pub player_connection: &'a mut PlayerConnection,
}
pub trait Handler<T>
where
T: AsyncWrite + Unpin,
{
fn handle(&self, arg: IrcConnection<T>) -> impl Future<Output = anyhow::Result<()>>;
}