Struct thrift::transport::TFramedWriteTransport [] [src]

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

Transport that writes framed messages.

A TFramedWriteTransport maintains a fixed-size internal write buffer. All writes are made to this buffer and are sent to the wrapped channel only when TFramedWriteTransport::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 TFramedWriteTransport.

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

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

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

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

Methods

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

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

Create a TFramedTransport 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 TFramedWriteTransport<C> where
    C: Write
[src]

Formats the value using the given formatter.

impl<C> Write for TFramedWriteTransport<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