Struct ProstSerializer

Source
pub struct ProstSerializer<Deserialized, Serialized> { /* private fields */ }
Expand description

A stateless implementation of protosocket’s Serializer and Deserializer traits using prost for encoding and decoding protocol buffers messages.

Trait Implementations§

Source§

impl<Deserialized: Debug, Serialized: Debug> Debug for ProstSerializer<Deserialized, Serialized>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Deserialized: Default, Serialized: Default> Default for ProstSerializer<Deserialized, Serialized>

Source§

fn default() -> ProstSerializer<Deserialized, Serialized>

Returns the “default value” for a type. Read more
Source§

impl<Deserialized, Serialized> Deserializer for ProstSerializer<Deserialized, Serialized>
where Deserialized: Message + Default + Unpin, Serialized: Message + Unpin,

Source§

type Message = Deserialized

The message type produced by this deserializer.
Source§

fn decode( &mut self, buffer: impl Buf, ) -> Result<(usize, Self::Message), DeserializeError>

Decode a message from the buffer, or tell why you can’t. Read more
Source§

impl<Deserialized, Serialized> Serializer for ProstSerializer<Deserialized, Serialized>
where Deserialized: Message + Default + Unpin, Serialized: Message + Unpin,

Source§

type Message = Serialized

The message type consumed by this serializer.
Source§

fn encode(&mut self, message: Self::Message, buffer: &mut Vec<u8>)

Encode a message into a buffer.

Auto Trait Implementations§

§

impl<Deserialized, Serialized> Freeze for ProstSerializer<Deserialized, Serialized>

§

impl<Deserialized, Serialized> RefUnwindSafe for ProstSerializer<Deserialized, Serialized>
where Deserialized: RefUnwindSafe, Serialized: RefUnwindSafe,

§

impl<Deserialized, Serialized> Send for ProstSerializer<Deserialized, Serialized>
where Deserialized: Send, Serialized: Send,

§

impl<Deserialized, Serialized> Sync for ProstSerializer<Deserialized, Serialized>
where Deserialized: Sync, Serialized: Sync,

§

impl<Deserialized, Serialized> Unpin for ProstSerializer<Deserialized, Serialized>
where Deserialized: Unpin, Serialized: Unpin,

§

impl<Deserialized, Serialized> UnwindSafe for ProstSerializer<Deserialized, Serialized>
where Deserialized: UnwindSafe, Serialized: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.