polars_parquet_format::thrift::protocol

Trait TOutputProtocol

Source
pub trait TOutputProtocol {
Show 23 methods // Required methods fn write_message_begin( &mut self, identifier: &TMessageIdentifier, ) -> Result<usize>; fn write_message_end(&mut self) -> Result<usize>; fn write_struct_begin( &mut self, identifier: &TStructIdentifier, ) -> Result<usize>; fn write_struct_end(&mut self) -> Result<usize>; fn write_field_begin( &mut self, identifier: &TFieldIdentifier, ) -> Result<usize>; fn write_field_end(&mut self) -> Result<usize>; fn write_field_stop(&mut self) -> Result<usize>; fn write_bool(&mut self, b: bool) -> Result<usize>; fn write_bytes(&mut self, b: &[u8]) -> Result<usize>; fn write_i8(&mut self, i: i8) -> Result<usize>; fn write_i16(&mut self, i: i16) -> Result<usize>; fn write_i32(&mut self, i: i32) -> Result<usize>; fn write_i64(&mut self, i: i64) -> Result<usize>; fn write_double(&mut self, d: f64) -> Result<usize>; fn write_string(&mut self, s: &str) -> Result<usize>; fn write_list_begin( &mut self, identifier: &TListIdentifier, ) -> Result<usize>; fn write_list_end(&mut self) -> Result<usize>; fn write_set_begin(&mut self, identifier: &TSetIdentifier) -> Result<usize>; fn write_set_end(&mut self) -> Result<usize>; fn write_map_begin(&mut self, identifier: &TMapIdentifier) -> Result<usize>; fn write_map_end(&mut self) -> Result<usize>; fn flush(&mut self) -> Result<()>; fn write_byte(&mut self, b: u8) -> Result<usize>;
}
Expand description

Converts Thrift identifiers, primitives, containers or structs into a stream of bytes.

This trait does not deal with higher-level Thrift concepts like structs or exceptions - only with primitives and message or container boundaries. Write methods take an identifier (for example, TMessageIdentifier) or a primitive. Any or all of the fields in an identifier may be omitted when writing to the transport. Write methods may even be noops. All of this is transparent to the caller; as long as a matching TInputProtocol implementation is used, received messages will be decoded correctly.

All methods return a thrift::Result. If an Err is returned the protocol instance and its underlying transport should be terminated.

Required Methods§

Source

fn write_message_begin( &mut self, identifier: &TMessageIdentifier, ) -> Result<usize>

Write the beginning of a Thrift message.

Source

fn write_message_end(&mut self) -> Result<usize>

Write the end of a Thrift message.

Source

fn write_struct_begin( &mut self, identifier: &TStructIdentifier, ) -> Result<usize>

Write the beginning of a Thrift struct.

Source

fn write_struct_end(&mut self) -> Result<usize>

Write the end of a Thrift struct.

Source

fn write_field_begin(&mut self, identifier: &TFieldIdentifier) -> Result<usize>

Write the beginning of a Thrift field.

Source

fn write_field_end(&mut self) -> Result<usize>

Write the end of a Thrift field.

Source

fn write_field_stop(&mut self) -> Result<usize>

Write a STOP field indicating that all the fields in a struct have been written.

Source

fn write_bool(&mut self, b: bool) -> Result<usize>

Write a bool.

Source

fn write_bytes(&mut self, b: &[u8]) -> Result<usize>

Write a fixed-length byte array.

Source

fn write_i8(&mut self, i: i8) -> Result<usize>

Write an 8-bit signed integer.

Source

fn write_i16(&mut self, i: i16) -> Result<usize>

Write a 16-bit signed integer.

Source

fn write_i32(&mut self, i: i32) -> Result<usize>

Write a 32-bit signed integer.

Source

fn write_i64(&mut self, i: i64) -> Result<usize>

Write a 64-bit signed integer.

Source

fn write_double(&mut self, d: f64) -> Result<usize>

Write a 64-bit float.

Source

fn write_string(&mut self, s: &str) -> Result<usize>

Write a fixed-length string.

Source

fn write_list_begin(&mut self, identifier: &TListIdentifier) -> Result<usize>

Write the beginning of a list.

Source

fn write_list_end(&mut self) -> Result<usize>

Write the end of a list.

Source

fn write_set_begin(&mut self, identifier: &TSetIdentifier) -> Result<usize>

Write the beginning of a set.

Source

fn write_set_end(&mut self) -> Result<usize>

Write the end of a set.

Source

fn write_map_begin(&mut self, identifier: &TMapIdentifier) -> Result<usize>

Write the beginning of a map.

Source

fn write_map_end(&mut self) -> Result<usize>

Write the end of a map.

Source

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

Flush buffered bytes to the underlying transport.

Source

fn write_byte(&mut self, b: u8) -> Result<usize>

Write an unsigned byte.

This method should never be used in generated code.

Implementations on Foreign Types§

Source§

impl<P> TOutputProtocol for Box<P>
where P: TOutputProtocol + ?Sized,

Source§

fn write_message_begin( &mut self, identifier: &TMessageIdentifier, ) -> Result<usize>

Source§

fn write_message_end(&mut self) -> Result<usize>

Source§

fn write_struct_begin( &mut self, identifier: &TStructIdentifier, ) -> Result<usize>

Source§

fn write_struct_end(&mut self) -> Result<usize>

Source§

fn write_field_begin(&mut self, identifier: &TFieldIdentifier) -> Result<usize>

Source§

fn write_field_end(&mut self) -> Result<usize>

Source§

fn write_field_stop(&mut self) -> Result<usize>

Source§

fn write_bool(&mut self, b: bool) -> Result<usize>

Source§

fn write_bytes(&mut self, b: &[u8]) -> Result<usize>

Source§

fn write_i8(&mut self, i: i8) -> Result<usize>

Source§

fn write_i16(&mut self, i: i16) -> Result<usize>

Source§

fn write_i32(&mut self, i: i32) -> Result<usize>

Source§

fn write_i64(&mut self, i: i64) -> Result<usize>

Source§

fn write_double(&mut self, d: f64) -> Result<usize>

Source§

fn write_string(&mut self, s: &str) -> Result<usize>

Source§

fn write_list_begin(&mut self, identifier: &TListIdentifier) -> Result<usize>

Source§

fn write_list_end(&mut self) -> Result<usize>

Source§

fn write_set_begin(&mut self, identifier: &TSetIdentifier) -> Result<usize>

Source§

fn write_set_end(&mut self) -> Result<usize>

Source§

fn write_map_begin(&mut self, identifier: &TMapIdentifier) -> Result<usize>

Source§

fn write_map_end(&mut self) -> Result<usize>

Source§

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

Source§

fn write_byte(&mut self, b: u8) -> Result<usize>

Implementors§