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

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]

Important traits for TFramedWriteTransport<C>
pub fn new(channel: C) -> TFramedWriteTransport<C>[src]

Create a TFramedWriteTransport with default-sized internal write buffer that wraps the given TIoChannel.

Important traits for TFramedWriteTransport<C>
pub fn with_capacity(
    write_capacity: usize,
    channel: C
) -> TFramedWriteTransport<C>
[src]

Create a TFramedWriteTransport with 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]

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

Auto Trait Implementations

impl<C> Send for TFramedWriteTransport<C> where
    C: Send

impl<C> Sync for TFramedWriteTransport<C> where
    C: Sync

impl<C> Unpin for TFramedWriteTransport<C> where
    C: Unpin

impl<C> UnwindSafe for TFramedWriteTransport<C> where
    C: UnwindSafe

impl<C> RefUnwindSafe for TFramedWriteTransport<C> where
    C: RefUnwindSafe

Blanket Implementations

impl<T> TWriteTransport for T where
    T: Write
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]

impl<Inner> VarIntWriter for Inner where
    Inner: Write
[src]

impl<W> FixedIntWriter for W where
    W: Write
[src]