Trait cloudevents::message::MessageDeserializer

source ·
pub trait MessageDeserializer{
    // Required method
    fn encoding(&self) -> Encoding;

    // Provided methods
    fn into_event(self) -> Result<Event> { ... }
    fn deserialize_to_binary<R: Sized, T: BinarySerializer<R>>(
        self,
        serializer: T,
    ) -> Result<R> { ... }
    fn deserialize_to_structured<R: Sized, T: StructuredSerializer<R>>(
        self,
        serializer: T,
    ) -> Result<R> { ... }
    fn deserialize_to<R: Sized, T: BinarySerializer<R> + StructuredSerializer<R>>(
        self,
        serializer: T,
    ) -> Result<R> { ... }
}
Expand description

Deserializer trait for a Message that can be encoded both in structured mode or binary mode.

Required Methods§

source

fn encoding(&self) -> Encoding

Get this message Encoding.

Provided Methods§

source

fn into_event(self) -> Result<Event>

Convert this Message to Event.

source

fn deserialize_to_binary<R: Sized, T: BinarySerializer<R>>( self, serializer: T, ) -> Result<R>

Deserialize the message to BinarySerializer.

source

fn deserialize_to_structured<R: Sized, T: StructuredSerializer<R>>( self, serializer: T, ) -> Result<R>

Deserialize the message to StructuredSerializer.

source

fn deserialize_to<R: Sized, T: BinarySerializer<R> + StructuredSerializer<R>>( self, serializer: T, ) -> Result<R>

Deserialize the message to a serializer, depending on the message encoding. You can use this method to transcode this message directly to another serializer, without going through Event.

Object Safety§

This trait is not object safe.

Implementors§