11macro_rules! decoder {
2- ( $( #[ $attr: meta] ) * $name: ident<$inner : ident> $( { $( $constructor : tt) * } ) * ) => {
2+ ( $( #[ $attr: meta] ) * $name: ident $( { $( $inherent_methods : tt) * } ) * ) => {
33 pin_project_lite:: pin_project! {
44 $( #[ $attr] ) *
55 ///
66 /// This structure implements an [`AsyncRead`](futures_io::AsyncRead) interface and will
77 /// read compressed data from an underlying stream and emit a stream of uncompressed data.
88 #[ derive( Debug ) ]
9- pub struct $name<$inner > {
9+ pub struct $name<R > {
1010 #[ pin]
11- inner: crate :: futures:: bufread:: Decoder <$inner , crate :: codec:: $name>,
11+ inner: crate :: futures:: bufread:: Decoder <R , crate :: codec:: $name>,
1212 }
1313 }
1414
15- impl <$inner : futures_io:: AsyncBufRead > $name<$inner > {
15+ impl <R : futures_io:: AsyncBufRead > $name<R > {
1616 /// Creates a new decoder which will read compressed data from the given stream and
1717 /// emit a uncompressed stream.
18- pub fn new( read: $inner ) -> $name<$inner > {
18+ pub fn new( read: R ) -> $name<R > {
1919 $name {
2020 inner: crate :: futures:: bufread:: Decoder :: new( read, crate :: codec:: $name:: new( ) ) ,
2121 }
2222 }
2323
24- $(
25- $( $constructor) *
26- ) *
24+ $( $( $inherent_methods) * ) *
2725
2826 /// Configure multi-member/frame decoding, if enabled this will reset the decoder state
2927 /// when reaching the end of a compressed member/frame and expect either EOF or another
@@ -33,7 +31,7 @@ macro_rules! decoder {
3331 }
3432
3533 /// Acquires a reference to the underlying reader that this decoder is wrapping.
36- pub fn get_ref( & self ) -> & $inner {
34+ pub fn get_ref( & self ) -> & R {
3735 self . inner. get_ref( )
3836 }
3937
@@ -42,7 +40,7 @@ macro_rules! decoder {
4240 ///
4341 /// Note that care must be taken to avoid tampering with the state of the reader which
4442 /// may otherwise confuse this decoder.
45- pub fn get_mut( & mut self ) -> & mut $inner {
43+ pub fn get_mut( & mut self ) -> & mut R {
4644 self . inner. get_mut( )
4745 }
4846
@@ -51,20 +49,20 @@ macro_rules! decoder {
5149 ///
5250 /// Note that care must be taken to avoid tampering with the state of the reader which
5351 /// may otherwise confuse this decoder.
54- pub fn get_pin_mut( self : std:: pin:: Pin <& mut Self >) -> std:: pin:: Pin <& mut $inner > {
52+ pub fn get_pin_mut( self : std:: pin:: Pin <& mut Self >) -> std:: pin:: Pin <& mut R > {
5553 self . project( ) . inner. get_pin_mut( )
5654 }
5755
5856 /// Consumes this decoder returning the underlying reader.
5957 ///
6058 /// Note that this may discard internal state of this decoder, so care should be taken
6159 /// to avoid losing resources when this is called.
62- pub fn into_inner( self ) -> $inner {
60+ pub fn into_inner( self ) -> R {
6361 self . inner. into_inner( )
6462 }
6563 }
6664
67- impl <$inner : futures_io:: AsyncBufRead > futures_io:: AsyncRead for $name<$inner > {
65+ impl <R : futures_io:: AsyncBufRead > futures_io:: AsyncRead for $name<R > {
6866 fn poll_read(
6967 self : std:: pin:: Pin <& mut Self >,
7068 cx: & mut std:: task:: Context <' _>,
0 commit comments