pub trait TInputProtocol: Sized {
Show 24 methods
// Required methods
fn read_message_begin(&mut self) -> Result<TMessageIdentifier>;
fn read_message_end(&mut self) -> Result<()>;
fn read_struct_begin(&mut self) -> Result<Option<TStructIdentifier>>;
fn read_struct_end(&mut self) -> Result<()>;
fn read_field_begin(&mut self) -> Result<TFieldIdentifier>;
fn read_field_end(&mut self) -> Result<()>;
fn read_bool(&mut self) -> Result<bool>;
fn read_bytes(&mut self) -> Result<Vec<u8>>;
fn read_i8(&mut self) -> Result<i8>;
fn read_i16(&mut self) -> Result<i16>;
fn read_i32(&mut self) -> Result<i32>;
fn read_i64(&mut self) -> Result<i64>;
fn read_double(&mut self) -> Result<f64>;
fn read_string(&mut self) -> Result<String>;
fn read_list_begin(&mut self) -> Result<TListIdentifier>;
fn read_list_end(&mut self) -> Result<()>;
fn read_set_begin(&mut self) -> Result<TSetIdentifier>;
fn read_set_end(&mut self) -> Result<()>;
fn read_map_begin(&mut self) -> Result<TMapIdentifier>;
fn read_map_end(&mut self) -> Result<()>;
fn read_byte(&mut self) -> Result<u8>;
// Provided methods
fn skip(&mut self, field_type: TType) -> Result<()> { ... }
fn skip_till_depth(&mut self, field_type: TType, depth: i8) -> Result<()> { ... }
fn read_list<P: ReadThrift>(&mut self) -> Result<Vec<P>> { ... }
}
Expand description
Converts a stream of bytes into Thrift identifiers, primitives, containers, or structs.
This trait does not deal with higher-level Thrift concepts like structs or
exceptions - only with primitives and message or container boundaries. Once
bytes are read they are deserialized and an identifier (for example
TMessageIdentifier
) or a primitive is returned.
All methods return a thrift::Result
. If an Err
is returned the protocol
instance and its underlying transport should be terminated.
Required Methods§
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.
Provided Methods§
Sourcefn skip(&mut self, field_type: TType) -> Result<()>
fn skip(&mut self, field_type: TType) -> Result<()>
Skip a field with type field_type
recursively until the default
maximum skip depth is reached.
Sourcefn skip_till_depth(&mut self, field_type: TType, depth: i8) -> Result<()>
fn skip_till_depth(&mut self, field_type: TType, depth: i8) -> Result<()>
Skip a field with type field_type
recursively up to depth
levels.
fn read_list<P: ReadThrift>(&mut self) -> Result<Vec<P>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.