Struct thrift::transport::TBufferedWriteTransport [−][src]
pub struct TBufferedWriteTransport<C> where
C: Write, { /* fields omitted */ }
Expand description
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();
Implementations
pub fn new(channel: C) -> TBufferedWriteTransport<C>ⓘNotable traits for TBufferedWriteTransport<C>impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
pub fn new(channel: C) -> TBufferedWriteTransport<C>ⓘNotable traits for TBufferedWriteTransport<C>impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
Create a TBufferedTransport
with default-sized internal read and
write buffers that wraps the given TIoChannel
.
pub fn with_capacity(
write_capacity: usize,
channel: C
) -> TBufferedWriteTransport<C>ⓘNotable traits for TBufferedWriteTransport<C>impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
pub fn with_capacity(
write_capacity: usize,
channel: C
) -> TBufferedWriteTransport<C>ⓘNotable traits for TBufferedWriteTransport<C>impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
impl<C> Write for TBufferedWriteTransport<C> where
C: Write,
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
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for TBufferedWriteTransport<C> where
C: RefUnwindSafe,
impl<C> Send for TBufferedWriteTransport<C> where
C: Send,
impl<C> Sync for TBufferedWriteTransport<C> where
C: Sync,
impl<C> Unpin for TBufferedWriteTransport<C> where
C: Unpin,
impl<C> UnwindSafe for TBufferedWriteTransport<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Writes an unsigned 8 bit integer to the underlying writer. Read more
Writes a signed 8 bit integer to the underlying writer. Read more
Writes an unsigned 16 bit integer to the underlying writer. Read more
Writes a signed 16 bit integer to the underlying writer. Read more
Writes an unsigned 24 bit integer to the underlying writer. Read more
Writes a signed 24 bit integer to the underlying writer. Read more
Writes an unsigned 32 bit integer to the underlying writer. Read more
Writes a signed 32 bit integer to the underlying writer. Read more
Writes an unsigned 48 bit integer to the underlying writer. Read more
Writes a signed 48 bit integer to the underlying writer. Read more
Writes an unsigned 64 bit integer to the underlying writer. Read more
Writes a signed 64 bit integer to the underlying writer. Read more
Writes an unsigned 128 bit integer to the underlying writer.
Writes a signed 128 bit integer to the underlying writer.
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more