diff options
author | Joey Sacchini <joey@sacchini.net> | 2021-01-09 14:36:46 -0500 |
---|---|---|
committer | Joey Sacchini <joey@sacchini.net> | 2021-01-09 14:36:46 -0500 |
commit | a3927e752c55dbc70d135ff97cf809eb356d60a4 (patch) | |
tree | b270146fa27e335e7cdf95f05138cb3123a26c33 /src/reader.rs | |
parent | b67603827b24272517b43a7249b0f63625308735 (diff) | |
download | craftio-rs-a3927e752c55dbc70d135ff97cf809eb356d60a4.tar.gz craftio-rs-a3927e752c55dbc70d135ff97cf809eb356d60a4.tar.bz2 craftio-rs-a3927e752c55dbc70d135ff97cf809eb356d60a4.zip |
add a readme and cleanup some of the wrapper methods in CraftConnection
Diffstat (limited to 'src/reader.rs')
-rw-r--r-- | src/reader.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/reader.rs b/src/reader.rs index b3bb2dd..1439a17 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -401,37 +401,6 @@ where } #[cfg(any(feature = "futures-io", feature = "tokio-io"))] -pub trait IntoBufferedAsyncRead { - type Target: AsyncReadExact; - - fn into_buffered(self, capacity: usize) -> Self::Target; -} - -#[cfg(all(feature = "futures-io", not(feature = "tokio-io")))] -impl<R> IntoBufferedAsyncRead for R -where - R: futures::io::AsyncRead + Send + Sync + Unpin, -{ - type Target = futures::io::BufReader<R>; - - fn into_buffered(self, capacity: usize) -> Self::Target { - futures::io::BufReader::with_capacity(capacity, self) - } -} - -#[cfg(feature = "tokio-io")] -impl<R> IntoBufferedAsyncRead for R -where - R: tokio::io::AsyncRead + Send + Sync + Unpin, -{ - type Target = tokio::io::BufReader<R>; - - fn into_buffered(self, capacity: usize) -> Self::Target { - tokio::io::BufReader::with_capacity(capacity, self) - } -} - -#[cfg(any(feature = "futures-io", feature = "tokio-io"))] #[async_trait] pub trait AsyncReadExact: Unpin + Sync + Send { async fn read_exact(&mut self, to: &mut [u8]) -> Result<(), io::Error>; |