use tokio::io::AsyncWriteExt;
use tokio::net::tcp::OwnedWriteHalf;
pub struct ProxyWriter {
pub write_stream: OwnedWriteHalf,
}
impl ProxyWriter {
pub async fn shutdown(&mut self) -> std::io::Result<()> {
self.write_stream.shutdown().await
}
pub async fn write(&mut self, buffer: impl Into<&[u8]>) -> std::io::Result<()> {
self.write_stream.write_all(buffer.into()).await
}
}