Struct thrift::protocol::TCompactInputProtocol
source · [−]pub struct TCompactInputProtocol<T>where
T: TReadTransport,{ /* private fields */ }
Expand description
Read messages encoded in the Thrift compact protocol.
Examples
Create and use a TCompactInputProtocol
.
use thrift::protocol::{TCompactInputProtocol, TInputProtocol};
use thrift::transport::TTcpChannel;
let mut channel = TTcpChannel::new();
channel.open("localhost:9090").unwrap();
let mut protocol = TCompactInputProtocol::new(channel);
let recvd_bool = protocol.read_bool().unwrap();
let recvd_string = protocol.read_string().unwrap();
Implementations
sourceimpl<T> TCompactInputProtocol<T>where
T: TReadTransport,
impl<T> TCompactInputProtocol<T>where
T: TReadTransport,
sourcepub fn new(transport: T) -> TCompactInputProtocol<T>
pub fn new(transport: T) -> TCompactInputProtocol<T>
Create a TCompactInputProtocol
that reads bytes from transport
.
Trait Implementations
sourceimpl<T: Debug> Debug for TCompactInputProtocol<T>where
T: TReadTransport,
impl<T: Debug> Debug for TCompactInputProtocol<T>where
T: TReadTransport,
sourceimpl<T> Seek for TCompactInputProtocol<T>where
T: Seek + TReadTransport,
impl<T> Seek for TCompactInputProtocol<T>where
T: Seek + TReadTransport,
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl<T> TInputProtocol for TCompactInputProtocol<T>where
T: TReadTransport,
impl<T> TInputProtocol for TCompactInputProtocol<T>where
T: TReadTransport,
sourcefn read_message_begin(&mut self) -> Result<TMessageIdentifier>
fn read_message_begin(&mut self) -> Result<TMessageIdentifier>
Read the beginning of a Thrift message.
sourcefn read_message_end(&mut self) -> Result<()>
fn read_message_end(&mut self) -> Result<()>
Read the end of a Thrift message.
sourcefn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>
fn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>
Read the beginning of a Thrift struct.
sourcefn read_struct_end(&mut self) -> Result<()>
fn read_struct_end(&mut self) -> Result<()>
Read the end of a Thrift struct.
sourcefn read_field_begin(&mut self) -> Result<TFieldIdentifier>
fn read_field_begin(&mut self) -> Result<TFieldIdentifier>
Read the beginning of a Thrift struct field.
sourcefn read_field_end(&mut self) -> Result<()>
fn read_field_end(&mut self) -> Result<()>
Read the end of a Thrift struct field.
sourcefn read_bytes(&mut self) -> Result<Vec<u8>>
fn read_bytes(&mut self) -> Result<Vec<u8>>
Read a fixed-length byte array.
sourcefn read_double(&mut self) -> Result<f64>
fn read_double(&mut self) -> Result<f64>
Read a 64-bit float.
sourcefn read_string(&mut self) -> Result<String>
fn read_string(&mut self) -> Result<String>
Read a fixed-length string (not null terminated).
sourcefn read_list_begin(&mut self) -> Result<TListIdentifier>
fn read_list_begin(&mut self) -> Result<TListIdentifier>
Read the beginning of a list.
sourcefn read_list_end(&mut self) -> Result<()>
fn read_list_end(&mut self) -> Result<()>
Read the end of a list.
sourcefn read_set_begin(&mut self) -> Result<TSetIdentifier>
fn read_set_begin(&mut self) -> Result<TSetIdentifier>
Read the beginning of a set.
sourcefn read_set_end(&mut self) -> Result<()>
fn read_set_end(&mut self) -> Result<()>
Read the end of a set.
sourcefn read_map_begin(&mut self) -> Result<TMapIdentifier>
fn read_map_begin(&mut self) -> Result<TMapIdentifier>
Read the beginning of a map.
sourcefn read_map_end(&mut self) -> Result<()>
fn read_map_end(&mut self) -> Result<()>
Read the end of a map.
Auto Trait Implementations
impl<T> RefUnwindSafe for TCompactInputProtocol<T>where
T: RefUnwindSafe,
impl<T> Send for TCompactInputProtocol<T>where
T: Send,
impl<T> Sync for TCompactInputProtocol<T>where
T: Sync,
impl<T> Unpin for TCompactInputProtocol<T>where
T: Unpin,
impl<T> UnwindSafe for TCompactInputProtocol<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more