Struct thrift::transport::TFramedWriteTransport [−][src]
pub struct TFramedWriteTransport<C> where
C: Write, { /* fields omitted */ }
Expand description
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();
Implementations
pub fn new(channel: C) -> TFramedWriteTransport<C>ⓘNotable traits for TFramedWriteTransport<C>impl<C> Write for TFramedWriteTransport<C> where
C: Write,
pub fn new(channel: C) -> TFramedWriteTransport<C>ⓘNotable traits for TFramedWriteTransport<C>impl<C> Write for TFramedWriteTransport<C> where
C: Write,
impl<C> Write for TFramedWriteTransport<C> where
C: Write,
Create a TFramedWriteTransport
with default-sized internal
write buffer that wraps the given TIoChannel
.
pub fn with_capacity(
write_capacity: usize,
channel: C
) -> TFramedWriteTransport<C>ⓘNotable traits for TFramedWriteTransport<C>impl<C> Write for TFramedWriteTransport<C> where
C: Write,
pub fn with_capacity(
write_capacity: usize,
channel: C
) -> TFramedWriteTransport<C>ⓘNotable traits for TFramedWriteTransport<C>impl<C> Write for TFramedWriteTransport<C> where
C: Write,
impl<C> Write for TFramedWriteTransport<C> where
C: Write,
Create a TFramedWriteTransport
with 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 TFramedWriteTransport<C> where
C: RefUnwindSafe,
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,
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