Trait mesh_protobuf::oneof::OneofEncode

source ·
pub trait OneofEncode<R> {
    // Required methods
    fn write_variant(self, writer: MessageWriter<'_, '_, R>);
    fn compute_variant_size(&mut self, sizer: MessageSizer<'_>);
}
Expand description

A trait for encoding a oneof field.

Required Methods§

source

fn write_variant(self, writer: MessageWriter<'_, '_, R>)

Write the variant to the writer.

source

fn compute_variant_size(&mut self, sizer: MessageSizer<'_>)

Compute the size of the variant.

Implementations on Foreign Types§

source§

impl<T, U, AnyR: 'static> OneofEncode<AnyR> for Result<T, U>
where T: DefaultEncoding, T::Encoding: FieldEncode<T, AnyR>, U: DefaultEncoding, U::Encoding: FieldEncode<U, AnyR>,

source§

fn write_variant(self, writer: MessageWriter<'_, '_, AnyR>)

source§

fn compute_variant_size(&mut self, sizer: MessageSizer<'_>)

Implementors§