zeloxy 0.2.2

A library for creating lightweight, asynchronous, and lag-free proxy connections.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use tokio::io::AsyncReadExt;
use tokio::net::tcp::OwnedReadHalf;

/// Отдельная рука для чтения данных из потока
pub struct ProxyReader {
  pub read_stream: OwnedReadHalf,
}

impl ProxyReader {
  /// Метод чтения буффера из потока
  pub async fn read(&mut self, buffer: impl Into<&mut [u8]>) -> std::io::Result<usize> {
    self.read_stream.read_exact(buffer.into()).await
  }
}