Skip to main content

ProstSerializer

Struct ProstSerializer 

Source
pub struct ProstSerializer<Message> { /* private fields */ }
Expand description

A stateless implementation of Serialize using prost

Trait Implementations§

Source§

impl<Message: Debug> Debug for ProstSerializer<Message>

Source§

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

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

impl<Message: Default> Default for ProstSerializer<Message>

Source§

fn default() -> ProstSerializer<Message>

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

impl<Message> Serialize for ProstSerializer<Message>
where Message: Message + Debug,

Source§

type Message = Message

Outbound message type, to be serialized into buffers.
Source§

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

Write a message into a pooled buffer

Auto Trait Implementations§

§

impl<Message> Freeze for ProstSerializer<Message>

§

impl<Message> RefUnwindSafe for ProstSerializer<Message>
where Message: RefUnwindSafe,

§

impl<Message> Send for ProstSerializer<Message>
where Message: Send,

§

impl<Message> Sync for ProstSerializer<Message>
where Message: Sync,

§

impl<Message> Unpin for ProstSerializer<Message>
where Message: Unpin,

§

impl<Message> UnsafeUnpin for ProstSerializer<Message>

§

impl<Message> UnwindSafe for ProstSerializer<Message>
where Message: 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> Encoder for T
where T: Serialize,

Source§

type Message = <T as Serialize>::Message

The message type consumed by this serializer.
Source§

type Serialized = OwnedBuffer

The type this serializer produces. Read more
Source§

fn encode( &mut self, message: <T as Encoder>::Message, ) -> <T as Encoder>::Serialized

Encode a message into a buffer.
Source§

fn return_buffer(&mut self, _buffer: Self::Serialized)

Buffers are sent back to the encoder once the message is sent. Buffers are not guaranteed to be advanced to the end. You can reset and reuse your buffer, if appropriate.
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.