Trait mesh::payload::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> OneofEncode<AnyR> for Result<T, U>
where AnyR: 'static, T: DefaultEncoding, <T as DefaultEncoding>::Encoding: FieldEncode<T, AnyR>, U: DefaultEncoding, <U as DefaultEncoding>::Encoding: FieldEncode<U, AnyR>,

source§

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

source§

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

Implementors§

source§

impl<AnyR> OneofEncode<AnyR> for CancelReason
where AnyR: 'static,