From: Max Carrara <m.carrara@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH pxar] decoder: aio: Make `TokioReader` public
Date: Fri, 21 Jul 2023 17:58:19 +0200 [thread overview]
Message-ID: <20230721155819.1096415-1-m.carrara@proxmox.com> (raw)
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
next reply other threads:[~2023-07-21 15:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 15:58 Max Carrara [this message]
2023-08-04 11:11 ` [pbs-devel] applied: " Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230721155819.1096415-1-m.carrara@proxmox.com \
--to=m.carrara@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.