Struct mesh_protobuf::protobuf::Encoder
source · pub struct Encoder<T, E, R> { /* private fields */ }
Expand description
An encoder for a single message of type T
, using the messaging encoding
E
.
Implementations§
source§impl<R, T: DefaultEncoding> Encoder<T, T::Encoding, R>where
T::Encoding: MessageEncode<T, R>,
impl<R, T: DefaultEncoding> Encoder<T, T::Encoding, R>where
T::Encoding: MessageEncode<T, R>,
source§impl<T, R, E: MessageEncode<T, R>> Encoder<T, E, R>
impl<T, R, E: MessageEncode<T, R>> Encoder<T, E, R>
sourcepub fn with_encoding(message: T) -> Self
pub fn with_encoding(message: T) -> Self
Creates an encoder for message
with a specific encoder.
sourcepub fn resource_count(&self) -> usize
pub fn resource_count(&self) -> usize
Returns the number of resources in the message.
sourcepub fn encode_into(self, buffer: &mut dyn Buffer, resources: &mut Vec<R>)
pub fn encode_into(self, buffer: &mut dyn Buffer, resources: &mut Vec<R>)
Encodes the message into buffer
.
Auto Trait Implementations§
impl<T, E, R> Freeze for Encoder<T, E, R>where
T: Freeze,
impl<T, E, R> RefUnwindSafe for Encoder<T, E, R>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E, R> Send for Encoder<T, E, R>
impl<T, E, R> Sync for Encoder<T, E, R>
impl<T, E, R> Unpin for Encoder<T, E, R>
impl<T, E, R> UnwindSafe for Encoder<T, E, R>where
T: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more