pub struct ThriftEncoder {
pub buf: Vec<u8>,
}Expand description
A Thrift binary encoder.
Fields§
§buf: Vec<u8>Implementations§
Source§impl ThriftEncoder
impl ThriftEncoder
pub fn new() -> Self
Sourcepub fn write_field_begin(&mut self, ftype: ThriftType, field_id: i16)
pub fn write_field_begin(&mut self, ftype: ThriftType, field_id: i16)
Write a field header (type + field id).
Sourcepub fn write_field_stop(&mut self)
pub fn write_field_stop(&mut self)
Write field stop marker.
Sourcepub fn write_bool(&mut self, val: bool)
pub fn write_bool(&mut self, val: bool)
Write a bool value.
Sourcepub fn write_string(&mut self, s: &str)
pub fn write_string(&mut self, s: &str)
Write a string (length-prefixed).
Sourcepub fn write_double(&mut self, val: f64)
pub fn write_double(&mut self, val: f64)
Write a double.
Trait Implementations§
Source§impl Clone for ThriftEncoder
impl Clone for ThriftEncoder
Source§fn clone(&self) -> ThriftEncoder
fn clone(&self) -> ThriftEncoder
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 ThriftEncoder
impl Debug for ThriftEncoder
Source§impl Default for ThriftEncoder
impl Default for ThriftEncoder
Source§fn default() -> ThriftEncoder
fn default() -> ThriftEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ThriftEncoder
impl RefUnwindSafe for ThriftEncoder
impl Send for ThriftEncoder
impl Sync for ThriftEncoder
impl Unpin for ThriftEncoder
impl UnsafeUnpin for ThriftEncoder
impl UnwindSafe for ThriftEncoder
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