pub struct ProtoEncoder {
pub buf: Vec<u8>,
}Expand description
A protobuf encoder.
Fields§
§buf: Vec<u8>Implementations§
Source§impl ProtoEncoder
impl ProtoEncoder
pub fn new() -> Self
pub fn write_varint_field(&mut self, field: u32, val: u64)
pub fn write_fixed64_field(&mut self, field: u32, val: u64)
pub fn write_fixed32_field(&mut self, field: u32, val: u32)
pub fn write_bytes_field(&mut self, field: u32, data: &[u8])
pub fn write_string_field(&mut self, field: u32, s: &str)
pub fn write_f32_field(&mut self, field: u32, val: f32)
pub fn write_f64_field(&mut self, field: u32, val: f64)
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ProtoEncoder
impl Clone for ProtoEncoder
Source§fn clone(&self) -> ProtoEncoder
fn clone(&self) -> ProtoEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtoEncoder
impl Debug for ProtoEncoder
Source§impl Default for ProtoEncoder
impl Default for ProtoEncoder
Source§fn default() -> ProtoEncoder
fn default() -> ProtoEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProtoEncoder
impl RefUnwindSafe for ProtoEncoder
impl Send for ProtoEncoder
impl Sync for ProtoEncoder
impl Unpin for ProtoEncoder
impl UnsafeUnpin for ProtoEncoder
impl UnwindSafe for ProtoEncoder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more