Struct thrift::protocol::TBinaryInputProtocol
source · pub struct TBinaryInputProtocol<T>where
T: TReadTransport,{
pub transport: T,
/* private fields */
}
Expand description
Read messages encoded in the Thrift simple binary encoding.
There are two available modes: strict
and non-strict
, where the
non-strict
version does not check for the protocol version in the
received message header.
§Examples
Create and use a TBinaryInputProtocol
.
use thrift::protocol::{TBinaryInputProtocol, TInputProtocol};
use thrift::transport::TTcpChannel;
let mut channel = TTcpChannel::new();
channel.open("localhost:9090").unwrap();
let mut protocol = TBinaryInputProtocol::new(channel, true);
let recvd_bool = protocol.read_bool().unwrap();
let recvd_string = protocol.read_string().unwrap();
Fields§
§transport: T
Implementations§
source§impl<'a, T> TBinaryInputProtocol<T>where
T: TReadTransport,
impl<'a, T> TBinaryInputProtocol<T>where
T: TReadTransport,
sourcepub fn new(transport: T, strict: bool) -> TBinaryInputProtocol<T>
pub fn new(transport: T, strict: bool) -> TBinaryInputProtocol<T>
Create a TBinaryInputProtocol
that reads bytes from transport
.
Set strict
to true
if all incoming messages contain the protocol
version number in the protocol header.
Trait Implementations§
source§impl<T> Debug for TBinaryInputProtocol<T>where
T: TReadTransport + Debug,
impl<T> Debug for TBinaryInputProtocol<T>where
T: TReadTransport + Debug,
source§impl<T> TInputProtocol for TBinaryInputProtocol<T>where
T: TReadTransport,
impl<T> TInputProtocol for TBinaryInputProtocol<T>where
T: TReadTransport,
source§fn read_message_begin(&mut self) -> Result<TMessageIdentifier>
fn read_message_begin(&mut self) -> Result<TMessageIdentifier>
Read the beginning of a Thrift message.
source§fn read_message_end(&mut self) -> Result<()>
fn read_message_end(&mut self) -> Result<()>
Read the end of a Thrift message.
source§fn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>
fn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>
Read the beginning of a Thrift struct.
source§fn read_struct_end(&mut self) -> Result<()>
fn read_struct_end(&mut self) -> Result<()>
Read the end of a Thrift struct.
source§fn read_field_begin(&mut self) -> Result<TFieldIdentifier>
fn read_field_begin(&mut self) -> Result<TFieldIdentifier>
Read the beginning of a Thrift struct field.
source§fn read_field_end(&mut self) -> Result<()>
fn read_field_end(&mut self) -> Result<()>
Read the end of a Thrift struct field.
source§fn read_double(&mut self) -> Result<f64>
fn read_double(&mut self) -> Result<f64>
Read a 64-bit float.
source§fn read_string(&mut self) -> Result<String>
fn read_string(&mut self) -> Result<String>
Read a fixed-length string (not null terminated).
source§fn read_list_begin(&mut self) -> Result<TListIdentifier>
fn read_list_begin(&mut self) -> Result<TListIdentifier>
Read the beginning of a list.
source§fn read_list_end(&mut self) -> Result<()>
fn read_list_end(&mut self) -> Result<()>
Read the end of a list.
source§fn read_set_begin(&mut self) -> Result<TSetIdentifier>
fn read_set_begin(&mut self) -> Result<TSetIdentifier>
Read the beginning of a set.
source§fn read_set_end(&mut self) -> Result<()>
fn read_set_end(&mut self) -> Result<()>
Read the end of a set.
source§fn read_map_begin(&mut self) -> Result<TMapIdentifier>
fn read_map_begin(&mut self) -> Result<TMapIdentifier>
Read the beginning of a map.
source§fn read_map_end(&mut self) -> Result<()>
fn read_map_end(&mut self) -> Result<()>
Read the end of a map.
Auto Trait Implementations§
impl<T> Freeze for TBinaryInputProtocol<T>where
T: Freeze,
impl<T> RefUnwindSafe for TBinaryInputProtocol<T>where
T: RefUnwindSafe,
impl<T> Send for TBinaryInputProtocol<T>where
T: Send,
impl<T> Sync for TBinaryInputProtocol<T>where
T: Sync,
impl<T> Unpin for TBinaryInputProtocol<T>where
T: Unpin,
impl<T> UnwindSafe for TBinaryInputProtocol<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