public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH pxar] decoder: aio: Make `TokioReader` public
@ 2023-07-21 15:58 Max Carrara
  2023-08-04 11:11 ` [pbs-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Max Carrara @ 2023-07-21 15:58 UTC (permalink / raw)
  To: pbs-devel

This exposes `decoder::aio::TokioReader<T>` in a similar manner to
`decoder::sync::StandardReader<T>`, which is necessary if one wants
to remain generic over `T: tokio::io::AsyncRead`, e.g.:

> struct FooDecoder<T: tokio::io::AsyncRead> {
>    decoder: aio::Decoder<aio::TokioReader<T>>,
> }

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
---
 src/decoder/aio.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/decoder/aio.rs b/src/decoder/aio.rs
index 200dd3d..e2166fe 100644
--- a/src/decoder/aio.rs
+++ b/src/decoder/aio.rs
@@ -85,6 +85,7 @@ mod tok {
     }

     impl<T: tokio::io::AsyncRead> TokioReader<T> {
+        /// Create a new [TokioReader] from a type that implements [AsyncRead](tokio::io::AsyncRead).
         pub fn new(inner: T) -> Self {
             Self { inner }
         }
@@ -130,4 +131,4 @@ mod tok {
 }

 #[cfg(feature = "tokio-io")]
-use tok::TokioReader;
+pub use tok::TokioReader;
--
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-04 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 15:58 [pbs-devel] [PATCH pxar] decoder: aio: Make `TokioReader` public Max Carrara
2023-08-04 11:11 ` [pbs-devel] applied: " Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal