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§
Provided Methods§
sourcefn into_event(self) -> Result<Event>
fn into_event(self) -> Result<Event>
Convert this Message to Event
.
sourcefn deserialize_to_binary<R: Sized, T: BinarySerializer<R>>(
self,
serializer: T,
) -> Result<R>
fn deserialize_to_binary<R: Sized, T: BinarySerializer<R>>( self, serializer: T, ) -> Result<R>
Deserialize the message to BinarySerializer
.
sourcefn deserialize_to_structured<R: Sized, T: StructuredSerializer<R>>(
self,
serializer: T,
) -> Result<R>
fn deserialize_to_structured<R: Sized, T: StructuredSerializer<R>>( self, serializer: T, ) -> Result<R>
Deserialize the message to StructuredSerializer
.
sourcefn deserialize_to<R: Sized, T: BinarySerializer<R> + StructuredSerializer<R>>(
self,
serializer: T,
) -> Result<R>
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.