Trait mesh::payload::oneof::OneofDecode

source ·
pub trait OneofDecode<'de, R>: Sized {
    // Required method
    fn read_variant(
        this: &mut InplaceOption<'_, Self>,
        number: u32,
        reader: FieldReader<'de, '_, R>,
    ) -> Result<(), Error>;
}
Expand description

A trait for decoding a oneof field.

Required Methods§

source

fn read_variant( this: &mut InplaceOption<'_, Self>, number: u32, reader: FieldReader<'de, '_, R>, ) -> Result<(), Error>

Read the specified variant from the reader.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'encoding, T, U, AnyR> OneofDecode<'encoding, AnyR> for Result<T, U>
where AnyR: 'static, T: DefaultEncoding, <T as DefaultEncoding>::Encoding: FieldDecode<'encoding, T, AnyR>, U: DefaultEncoding, <U as DefaultEncoding>::Encoding: FieldDecode<'encoding, U, AnyR>,

source§

fn read_variant( item: &mut InplaceOption<'_, Result<T, U>>, n: u32, field: FieldReader<'encoding, '_, AnyR>, ) -> Result<(), Error>

Implementors§

source§

impl<'encoding, AnyR> OneofDecode<'encoding, AnyR> for CancelReason
where AnyR: 'static,