Struct thrift::transport::TBufferedWriteTransport [] [src]

pub struct TBufferedWriteTransport<C> where
    C: Write
{ /* fields omitted */ }

Transport that writes messages via an internal buffer.

A TBufferedWriteTransport maintains a fixed-size internal write buffer. All writes are made to this buffer and are sent to the wrapped channel only when TBufferedWriteTransport::flush() is called. On a flush a fixed-length header with a count of the buffered bytes is written, followed by the bytes themselves.

Examples

Create and use a TBufferedWriteTransport.

use std::io::Write;
use thrift::transport::{TBufferedWriteTransport, TTcpChannel};

let mut c = TTcpChannel::new();
c.open("localhost:9090").unwrap();

let mut t = TBufferedWriteTransport::new(c);

t.write(&[0x00]).unwrap();
t.flush().unwrap();

Methods

impl<C> TBufferedWriteTransport<C> where
    C: Write
[src]

Create a TBufferedTransport with default-sized internal read and write buffers that wraps the given TIoChannel.

Create a TBufferedTransport with an internal read buffer of size read_capacity and an internal write buffer of size write_capacity that wraps the given TIoChannel.

Trait Implementations

impl<C: Debug> Debug for TBufferedWriteTransport<C> where
    C: Write
[src]

Formats the value using the given formatter.

impl<C> Write for TBufferedWriteTransport<C> where
    C: Write
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more