[pbs-devel] applied: [PATCH pxar] decoder: aio: Make `TokioReader` public

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Aug 4 13:11:42 CEST 2023


applied, thanks

On Fri, Jul 21, 2023 at 05:58:19PM +0200, Max Carrara wrote:
> 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 at 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





More information about the pbs-devel mailing list