mesh::payload

Trait MessageDecode

Source
pub trait MessageDecode<'a, T, R>: Sized {
    // Required method
    fn read_message(
        item: &mut InplaceOption<'_, T>,
        reader: MessageReader<'a, '_, R>,
    ) -> Result<(), Error>;
}
Expand description

The MessageEncode trait provides a message decoder for type T.

R is the external resource type, which allows decoding objects with non-protobuf resources such as file descriptors. Most implementors of this trait will be generic over all R.

Required Methods§

Source

fn read_message( item: &mut InplaceOption<'_, T>, reader: MessageReader<'a, '_, R>, ) -> Result<(), Error>

Reads a message into item.

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.

Implementors§

Source§

impl MessageDecode<'_, OwnedMessage, Resource> for MessageEncoder

Source§

impl<'a, T, R, E> MessageDecode<'a, Box<T>, R> for BoxEncoding<E>
where E: MessageDecode<'a, T, R>,

Source§

impl<'a, T, R, E> MessageDecode<'a, Arc<T>, R> for ArcEncoding<E>
where T: Clone, E: MessageDecode<'a, T, R>,

Source§

impl<'a, T, R, E> MessageDecode<'a, T, R> for MessageEncoding<E>
where E: MessageDecode<'a, T, R>,

Source§

impl<'de, T, E, R> MessageDecode<'de, T, R> for TransparentEncoding<E>
where T: Transparent, E: MessageDecode<'de, <T as Transparent>::Inner, R>,

Source§

impl<'de, T, R> MessageDecode<'de, T, R> for OneofEncoder
where T: OneofDecode<'de, R>,

Source§

impl<'de, T, R> MessageDecode<'de, T, R> for TableEncoder
where T: StructDecodeMetadata<'de, R>,

Source§

impl<R> MessageDecode<'_, Duration, R> for DurationEncoding

Source§

impl<R> MessageDecode<'_, ProtobufMessage, R> for ProtobufMessageEncoding

Source§

impl<R> MessageDecode<'_, SerializedMessage<R>, R> for SerializedMessageEncoder

Source§

impl<T, R> MessageDecode<'_, T, R> for ImpossibleField

Source§

impl<T, R> MessageDecode<'_, T, R> for ProstMessage
where T: Message + Default,