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§

source§

impl<T> TCompactInputProtocol<T>where T: TReadTransport,

source

pub fn new(transport: T) -> TCompactInputProtocol<T>

Create a TCompactInputProtocol that reads bytes from transport.

Trait Implementations§

source§

impl<T> Debug for TCompactInputProtocol<T>where T: TReadTransport + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Seek for TCompactInputProtocol<T>where T: Seek + TReadTransport,

source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.51.0 · source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
source§

impl<T> TInputProtocol for TCompactInputProtocol<T>where T: TReadTransport,

source§

fn read_message_begin(&mut self) -> Result<TMessageIdentifier>

Read the beginning of a Thrift message.
source§

fn read_message_end(&mut self) -> Result<()>

Read the end of a Thrift message.
source§

fn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>

Read the beginning of a Thrift struct.
source§

fn read_struct_end(&mut self) -> Result<()>

Read the end of a Thrift struct.
source§

fn read_field_begin(&mut self) -> Result<TFieldIdentifier>

Read the beginning of a Thrift struct field.
source§

fn read_field_end(&mut self) -> Result<()>

Read the end of a Thrift struct field.
source§

fn read_bool(&mut self) -> Result<bool>

Read a bool.
source§

fn read_bytes(&mut self) -> Result<Vec<u8>>

Read a fixed-length byte array.
source§

fn read_i8(&mut self) -> Result<i8>

Read a word.
source§

fn read_i16(&mut self) -> Result<i16>

Read a 16-bit signed integer.
source§

fn read_i32(&mut self) -> Result<i32>

Read a 32-bit signed integer.
source§

fn read_i64(&mut self) -> Result<i64>

Read a 64-bit signed integer.
source§

fn read_double(&mut self) -> Result<f64>

Read a 64-bit float.
source§

fn read_string(&mut self) -> Result<String>

Read a fixed-length string (not null terminated).
source§

fn read_list_begin(&mut self) -> Result<TListIdentifier>

Read the beginning of a list.
source§

fn read_list_end(&mut self) -> Result<()>

Read the end of a list.
source§

fn read_set_begin(&mut self) -> Result<TSetIdentifier>

Read the beginning of a set.
source§

fn read_set_end(&mut self) -> Result<()>

Read the end of a set.
source§

fn read_map_begin(&mut self) -> Result<TMapIdentifier>

Read the beginning of a map.
source§

fn read_map_end(&mut self) -> Result<()>

Read the end of a map.
source§

fn read_byte(&mut self) -> Result<u8>

Read an unsigned byte. Read more
source§

fn skip(&mut self, field_type: TType) -> Result<()>

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<()>

Skip a field with type field_type recursively up to depth levels.

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.