forked from lavina/lavina
25 lines
749 B
Rust
25 lines
749 B
Rust
use tokio::io::{AsyncWrite, AsyncWriteExt};
|
|
|
|
use crate::{prelude::Str, response::WriteResponse};
|
|
|
|
pub struct RplEndOfWhois318 {
|
|
client: Str,
|
|
nick: Str,
|
|
}
|
|
impl RplEndOfWhois318 {
|
|
pub fn new(client: Str, nick: Str) -> Self {
|
|
RplEndOfWhois318 { client, nick }
|
|
}
|
|
}
|
|
impl WriteResponse for RplEndOfWhois318 {
|
|
async fn write_response(&self, writer: &mut (impl AsyncWrite + Unpin)) -> std::io::Result<()> {
|
|
writer.write_all(b"318 ").await?;
|
|
writer.write_all(self.client.as_bytes()).await?;
|
|
writer.write_all(b" ").await?;
|
|
writer.write_all(self.nick.as_bytes()).await?;
|
|
writer.write_all(b" :").await?;
|
|
writer.write_all("End of /WHOIS list".as_bytes()).await?;
|
|
Ok(())
|
|
}
|
|
}
|