pub struct TBinaryProtocol<T> { /* private fields */ }Implementations§
Source§impl<T> TBinaryProtocol<T>
impl<T> TBinaryProtocol<T>
Sourcepub fn new(trans: T, zero_copy: bool) -> Self
pub fn new(trans: T, zero_copy: bool) -> Self
zero_copy only takes effect when T is BytesMut for input and
LinkedBytes for output.
Trait Implementations§
Source§impl TInputProtocol for TBinaryProtocol<&mut Bytes>
impl TInputProtocol for TBinaryProtocol<&mut Bytes>
type Buf = Bytes
Source§fn read_message_begin(&mut self) -> Result<TMessageIdentifier, ThriftException>
fn read_message_begin(&mut self) -> Result<TMessageIdentifier, ThriftException>
Read the beginning of a Thrift message.
Source§fn read_message_end(&mut self) -> Result<(), ThriftException>
fn read_message_end(&mut self) -> Result<(), ThriftException>
Read the end of a Thrift message.
Source§fn read_struct_begin(
&mut self,
) -> Result<Option<TStructIdentifier>, ThriftException>
fn read_struct_begin( &mut self, ) -> Result<Option<TStructIdentifier>, ThriftException>
Read the beginning of a Thrift struct.
Source§fn read_struct_end(&mut self) -> Result<(), ThriftException>
fn read_struct_end(&mut self) -> Result<(), ThriftException>
Read the end of a Thrift struct.
Source§fn read_field_begin(&mut self) -> Result<TFieldIdentifier, ThriftException>
fn read_field_begin(&mut self) -> Result<TFieldIdentifier, ThriftException>
Read the beginning of a Thrift struct field.
Source§fn read_field_end(&mut self) -> Result<(), ThriftException>
fn read_field_end(&mut self) -> Result<(), ThriftException>
Read the end of a Thrift struct field.
Source§fn read_bytes(&mut self) -> Result<Bytes, ThriftException>
fn read_bytes(&mut self) -> Result<Bytes, ThriftException>
Read a binary.
fn get_bytes( &mut self, ptr: Option<*const u8>, len: usize, ) -> Result<Bytes, ThriftException>
Source§fn read_double(&mut self) -> Result<f64, ThriftException>
fn read_double(&mut self) -> Result<f64, ThriftException>
Read a 64-bit float.
Source§fn read_string(&mut self) -> Result<String, ThriftException>
fn read_string(&mut self) -> Result<String, ThriftException>
Read a fixed-length string (not null terminated).
Source§fn read_faststr(&mut self) -> Result<FastStr, ThriftException>
fn read_faststr(&mut self) -> Result<FastStr, ThriftException>
Read a faststr.
Source§fn read_list_begin(&mut self) -> Result<TListIdentifier, ThriftException>
fn read_list_begin(&mut self) -> Result<TListIdentifier, ThriftException>
Read the beginning of a list.
Source§fn read_list_end(&mut self) -> Result<(), ThriftException>
fn read_list_end(&mut self) -> Result<(), ThriftException>
Read the end of a list.
Source§fn read_set_begin(&mut self) -> Result<TSetIdentifier, ThriftException>
fn read_set_begin(&mut self) -> Result<TSetIdentifier, ThriftException>
Read the beginning of a set.
Source§fn read_set_end(&mut self) -> Result<(), ThriftException>
fn read_set_end(&mut self) -> Result<(), ThriftException>
Read the end of a set.
Source§fn read_map_begin(&mut self) -> Result<TMapIdentifier, ThriftException>
fn read_map_begin(&mut self) -> Result<TMapIdentifier, ThriftException>
Read the beginning of a map.
Source§fn read_map_end(&mut self) -> Result<(), ThriftException>
fn read_map_end(&mut self) -> Result<(), ThriftException>
Read the end of a map.
Source§fn read_bytes_vec(&mut self) -> Result<Vec<u8>, ThriftException>
fn read_bytes_vec(&mut self) -> Result<Vec<u8>, ThriftException>
Read a Vec.
Source§fn skip(&mut self, field_type: TType) -> Result<usize, ThriftException>
fn skip(&mut self, field_type: TType) -> Result<usize, ThriftException>
Skip a field with type
field_type recursively until the default
maximum skip depth is reached.Source§fn skip_till_depth(
&mut self,
field_type: TType,
depth: i8,
) -> Result<usize, ThriftException>
fn skip_till_depth( &mut self, field_type: TType, depth: i8, ) -> Result<usize, ThriftException>
Skip a field with type
field_type recursively up to depth levels.Source§impl<T> TLengthProtocol for TBinaryProtocol<T>
impl<T> TLengthProtocol for TBinaryProtocol<T>
fn message_begin_len(&mut self, identifier: &TMessageIdentifier) -> usize
fn message_end_len(&mut self) -> usize
fn struct_begin_len(&mut self, _identifier: &TStructIdentifier) -> usize
fn struct_end_len(&mut self) -> usize
fn field_begin_len(&mut self, _field_type: TType, _id: Option<i16>) -> usize
fn field_end_len(&mut self) -> usize
fn field_stop_len(&mut self) -> usize
fn bool_len(&mut self, _b: bool) -> usize
fn bytes_len(&mut self, b: &[u8]) -> usize
fn byte_len(&mut self, _b: u8) -> usize
fn uuid_len(&mut self, _u: [u8; 16]) -> usize
fn i8_len(&mut self, _i: i8) -> usize
fn i16_len(&mut self, _i: i16) -> usize
fn i32_len(&mut self, _i: i32) -> usize
fn i64_len(&mut self, _i: i64) -> usize
fn double_len(&mut self, _d: f64) -> usize
fn string_len(&mut self, s: &str) -> usize
fn faststr_len(&mut self, s: &FastStr) -> usize
fn list_begin_len(&mut self, _identifier: TListIdentifier) -> usize
fn list_end_len(&mut self) -> usize
fn set_begin_len(&mut self, _identifier: TSetIdentifier) -> usize
fn set_end_len(&mut self) -> usize
fn map_begin_len(&mut self, _identifier: TMapIdentifier) -> usize
fn map_end_len(&mut self) -> usize
fn bytes_vec_len(&mut self, b: &[u8]) -> usize
Source§fn zero_copy_len(&mut self) -> usize
fn zero_copy_len(&mut self) -> usize
The zero copy length used to calculate the recommended malloc length.
Source§impl TOutputProtocol for TBinaryProtocol<&mut BytesMut>
impl TOutputProtocol for TBinaryProtocol<&mut BytesMut>
type BufMut = BytesMut
Source§fn write_message_begin(
&mut self,
identifier: &TMessageIdentifier,
) -> Result<(), ThriftException>
fn write_message_begin( &mut self, identifier: &TMessageIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a Thrift message.
Source§fn write_message_end(&mut self) -> Result<(), ThriftException>
fn write_message_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift message.
Source§fn write_struct_begin(
&mut self,
_: &TStructIdentifier,
) -> Result<(), ThriftException>
fn write_struct_begin( &mut self, _: &TStructIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a Thrift struct.
Source§fn write_struct_end(&mut self) -> Result<(), ThriftException>
fn write_struct_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift struct.
Source§fn write_field_begin(
&mut self,
field_type: TType,
id: i16,
) -> Result<(), ThriftException>
fn write_field_begin( &mut self, field_type: TType, id: i16, ) -> Result<(), ThriftException>
Write the beginning of a Thrift field.
Source§fn write_field_end(&mut self) -> Result<(), ThriftException>
fn write_field_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift field.
Source§fn write_field_stop(&mut self) -> Result<(), ThriftException>
fn write_field_stop(&mut self) -> Result<(), ThriftException>
Write a STOP field indicating that all the fields in a struct have been
written.
Source§fn write_bool(&mut self, b: bool) -> Result<(), ThriftException>
fn write_bool(&mut self, b: bool) -> Result<(), ThriftException>
Write a bool.
Source§fn write_bytes(&mut self, b: Bytes) -> Result<(), ThriftException>
fn write_bytes(&mut self, b: Bytes) -> Result<(), ThriftException>
Write a fixed-length byte array.
fn write_bytes_without_len(&mut self, b: Bytes) -> Result<(), ThriftException>
Source§fn write_byte(&mut self, b: u8) -> Result<(), ThriftException>
fn write_byte(&mut self, b: u8) -> Result<(), ThriftException>
Write a byte.
Source§fn write_uuid(&mut self, u: [u8; 16]) -> Result<(), ThriftException>
fn write_uuid(&mut self, u: [u8; 16]) -> Result<(), ThriftException>
Write a uuid.
Source§fn write_double(&mut self, d: f64) -> Result<(), ThriftException>
fn write_double(&mut self, d: f64) -> Result<(), ThriftException>
Write a 64-bit float.
Source§fn write_string(&mut self, s: &str) -> Result<(), ThriftException>
fn write_string(&mut self, s: &str) -> Result<(), ThriftException>
Write a fixed-length string.
Source§fn write_faststr(&mut self, s: FastStr) -> Result<(), ThriftException>
fn write_faststr(&mut self, s: FastStr) -> Result<(), ThriftException>
Write a fixed-length faststr.
Source§fn write_list_begin(
&mut self,
identifier: TListIdentifier,
) -> Result<(), ThriftException>
fn write_list_begin( &mut self, identifier: TListIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a list.
Source§fn write_list_end(&mut self) -> Result<(), ThriftException>
fn write_list_end(&mut self) -> Result<(), ThriftException>
Write the end of a list.
Source§fn write_set_begin(
&mut self,
identifier: TSetIdentifier,
) -> Result<(), ThriftException>
fn write_set_begin( &mut self, identifier: TSetIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a set.
Source§fn write_set_end(&mut self) -> Result<(), ThriftException>
fn write_set_end(&mut self) -> Result<(), ThriftException>
Write the end of a set.
Source§fn write_map_begin(
&mut self,
identifier: TMapIdentifier,
) -> Result<(), ThriftException>
fn write_map_begin( &mut self, identifier: TMapIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a map.
Source§fn write_map_end(&mut self) -> Result<(), ThriftException>
fn write_map_end(&mut self) -> Result<(), ThriftException>
Write the end of a map.
Source§fn flush(&mut self) -> Result<(), ThriftException>
fn flush(&mut self) -> Result<(), ThriftException>
Flush buffered bytes to the underlying transport.
Source§fn write_bytes_vec(&mut self, b: &[u8]) -> Result<(), ThriftException>
fn write_bytes_vec(&mut self, b: &[u8]) -> Result<(), ThriftException>
Write a Vec.
Source§impl TOutputProtocol for TBinaryProtocol<&mut LinkedBytes>
impl TOutputProtocol for TBinaryProtocol<&mut LinkedBytes>
type BufMut = LinkedBytes
Source§fn write_message_begin(
&mut self,
identifier: &TMessageIdentifier,
) -> Result<(), ThriftException>
fn write_message_begin( &mut self, identifier: &TMessageIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a Thrift message.
Source§fn write_message_end(&mut self) -> Result<(), ThriftException>
fn write_message_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift message.
Source§fn write_struct_begin(
&mut self,
_: &TStructIdentifier,
) -> Result<(), ThriftException>
fn write_struct_begin( &mut self, _: &TStructIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a Thrift struct.
Source§fn write_struct_end(&mut self) -> Result<(), ThriftException>
fn write_struct_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift struct.
Source§fn write_field_begin(
&mut self,
field_type: TType,
id: i16,
) -> Result<(), ThriftException>
fn write_field_begin( &mut self, field_type: TType, id: i16, ) -> Result<(), ThriftException>
Write the beginning of a Thrift field.
Source§fn write_field_end(&mut self) -> Result<(), ThriftException>
fn write_field_end(&mut self) -> Result<(), ThriftException>
Write the end of a Thrift field.
Source§fn write_field_stop(&mut self) -> Result<(), ThriftException>
fn write_field_stop(&mut self) -> Result<(), ThriftException>
Write a STOP field indicating that all the fields in a struct have been
written.
Source§fn write_bool(&mut self, b: bool) -> Result<(), ThriftException>
fn write_bool(&mut self, b: bool) -> Result<(), ThriftException>
Write a bool.
Source§fn write_bytes(&mut self, b: Bytes) -> Result<(), ThriftException>
fn write_bytes(&mut self, b: Bytes) -> Result<(), ThriftException>
Write a fixed-length byte array.
fn write_bytes_without_len(&mut self, b: Bytes) -> Result<(), ThriftException>
Source§fn write_byte(&mut self, b: u8) -> Result<(), ThriftException>
fn write_byte(&mut self, b: u8) -> Result<(), ThriftException>
Write a byte.
Source§fn write_uuid(&mut self, u: [u8; 16]) -> Result<(), ThriftException>
fn write_uuid(&mut self, u: [u8; 16]) -> Result<(), ThriftException>
Write a uuid.
Source§fn write_double(&mut self, d: f64) -> Result<(), ThriftException>
fn write_double(&mut self, d: f64) -> Result<(), ThriftException>
Write a 64-bit float.
Source§fn write_string(&mut self, s: &str) -> Result<(), ThriftException>
fn write_string(&mut self, s: &str) -> Result<(), ThriftException>
Write a fixed-length string.
Source§fn write_faststr(&mut self, s: FastStr) -> Result<(), ThriftException>
fn write_faststr(&mut self, s: FastStr) -> Result<(), ThriftException>
Write a fixed-length faststr.
Source§fn write_list_begin(
&mut self,
identifier: TListIdentifier,
) -> Result<(), ThriftException>
fn write_list_begin( &mut self, identifier: TListIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a list.
Source§fn write_list_end(&mut self) -> Result<(), ThriftException>
fn write_list_end(&mut self) -> Result<(), ThriftException>
Write the end of a list.
Source§fn write_set_begin(
&mut self,
identifier: TSetIdentifier,
) -> Result<(), ThriftException>
fn write_set_begin( &mut self, identifier: TSetIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a set.
Source§fn write_set_end(&mut self) -> Result<(), ThriftException>
fn write_set_end(&mut self) -> Result<(), ThriftException>
Write the end of a set.
Source§fn write_map_begin(
&mut self,
identifier: TMapIdentifier,
) -> Result<(), ThriftException>
fn write_map_begin( &mut self, identifier: TMapIdentifier, ) -> Result<(), ThriftException>
Write the beginning of a map.
Source§fn write_map_end(&mut self) -> Result<(), ThriftException>
fn write_map_end(&mut self) -> Result<(), ThriftException>
Write the end of a map.
Source§fn flush(&mut self) -> Result<(), ThriftException>
fn flush(&mut self) -> Result<(), ThriftException>
Flush buffered bytes to the underlying transport.
Source§fn write_bytes_vec(&mut self, b: &[u8]) -> Result<(), ThriftException>
fn write_bytes_vec(&mut self, b: &[u8]) -> Result<(), ThriftException>
Write a Vec.
Auto Trait Implementations§
impl<T> Freeze for TBinaryProtocol<T>where
T: Freeze,
impl<T> RefUnwindSafe for TBinaryProtocol<T>where
T: RefUnwindSafe,
impl<T> Send for TBinaryProtocol<T>where
T: Send,
impl<T> Sync for TBinaryProtocol<T>where
T: Sync,
impl<T> Unpin for TBinaryProtocol<T>where
T: Unpin,
impl<T> UnsafeUnpin for TBinaryProtocol<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TBinaryProtocol<T>where
T: 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