Skip to main content

OneofDecoder

Trait OneofDecoder 

Source
pub trait OneofDecoder: Oneof {
    // Required method
    fn oneof_decode_field<B: Buf + ?Sized>(
        value: &mut Self,
        tag: u32,
        wire_type: WireType,
        buf: Capped<'_, B>,
        ctx: DecodeContext,
    ) -> Result<(), DecodeError>;
}
Expand description

Relaxed owned decoding trait for oneofs.

Required Methods§

Source

fn oneof_decode_field<B: Buf + ?Sized>( value: &mut Self, tag: u32, wire_type: WireType, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes from the given buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> OneofDecoder for Option<T>

Source§

fn oneof_decode_field<B: Buf + ?Sized>( value: &mut Self, tag: u32, wire_type: WireType, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<T> OneofDecoder for Box<T>
where T: OneofDecoder,

Source§

fn oneof_decode_field<B: Buf + ?Sized>( value: &mut Self, tag: u32, wire_type: WireType, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Implementors§