Skip to main content

forward_all_decoder_methods_to

Macro forward_all_decoder_methods_to 

Source
pub macro forward_all_decoder_methods_to(
        // Make the caller provide an explicit `self` (using closure syntax),
        // so that `$inner:expr` can refer to `self` without violating hygiene.
        //
        // This isn't an actual closure, because it needs to work for both
        // `&self` and `&mut self` methods.
        |$self:ident| $inner:expr
    ) {
    ...
}
Expand description

Declares implementations of all Decoder methods, each of which forwards to a method of the same name on some underlying decoder, typically a field of type MemDecoder.

Call this macro within an impl block impl Decoder for $MyDecoder { ... }.