Struct thrift::protocol::TCompactOutputProtocol
[−]
[src]
pub struct TCompactOutputProtocol { /* fields omitted */ }
Write messages using the Thrift compact protocol.
Examples
Create and use a TCompactOutputProtocol
.
use std::cell::RefCell; use std::rc::Rc; use thrift::protocol::{TCompactOutputProtocol, TOutputProtocol}; use thrift::transport::{TTcpTransport, TTransport}; let mut transport = TTcpTransport::new(); transport.open("localhost:9090").unwrap(); let transport = Rc::new(RefCell::new(Box::new(transport) as Box<TTransport>)); let mut o_prot = TCompactOutputProtocol::new(transport); o_prot.write_bool(true).unwrap(); o_prot.write_string("test_string").unwrap();
Methods
impl TCompactOutputProtocol
[src]
fn new(transport: Rc<RefCell<Box<TTransport>>>) -> TCompactOutputProtocol
Create a TCompactOutputProtocol
that writes bytes to transport
.
Trait Implementations
impl TOutputProtocol for TCompactOutputProtocol
[src]
fn write_message_begin(&mut self, identifier: &TMessageIdentifier) -> Result<()>
Write the beginning of a Thrift message.
fn write_message_end(&mut self) -> Result<()>
Write the end of a Thrift message.
fn write_struct_begin(&mut self, _: &TStructIdentifier) -> Result<()>
Write the beginning of a Thrift struct.
fn write_struct_end(&mut self) -> Result<()>
Write the end of a Thrift struct.
fn write_field_begin(&mut self, identifier: &TFieldIdentifier) -> Result<()>
Write the beginning of a Thrift field.
fn write_field_end(&mut self) -> Result<()>
Write the end of a Thrift field.
fn write_field_stop(&mut self) -> Result<()>
Write a STOP field indicating that all the fields in a struct have been written. Read more
fn write_bool(&mut self, b: bool) -> Result<()>
Write a bool.
fn write_bytes(&mut self, b: &[u8]) -> Result<()>
Write a fixed-length byte array.
fn write_i8(&mut self, i: i8) -> Result<()>
Write an 8-bit signed integer.
fn write_i16(&mut self, i: i16) -> Result<()>
Write a 16-bit signed integer.
fn write_i32(&mut self, i: i32) -> Result<()>
Write a 32-bit signed integer.
fn write_i64(&mut self, i: i64) -> Result<()>
Write a 64-bit signed integer.
fn write_double(&mut self, d: f64) -> Result<()>
Write a 64-bit float.
fn write_string(&mut self, s: &str) -> Result<()>
Write a fixed-length string.
fn write_list_begin(&mut self, identifier: &TListIdentifier) -> Result<()>
Write the beginning of a list.
fn write_list_end(&mut self) -> Result<()>
Write the end of a list.
fn write_set_begin(&mut self, identifier: &TSetIdentifier) -> Result<()>
Write the beginning of a set.
fn write_set_end(&mut self) -> Result<()>
Write the end of a set.
fn write_map_begin(&mut self, identifier: &TMapIdentifier) -> Result<()>
Write the beginning of a map.
fn write_map_end(&mut self) -> Result<()>
Write the end of a map.
fn flush(&mut self) -> Result<()>
Flush buffered bytes to the underlying transport.
fn write_byte(&mut self, b: u8) -> Result<()>
Write an unsigned byte. Read more