Struct thrift::transport::TBufferedReadTransport [−][src]
pub struct TBufferedReadTransport<C> where
C: Read, { /* fields omitted */ }
Expand description
Transport that reads messages via an internal buffer.
A TBufferedReadTransport
maintains a fixed-size internal read buffer.
On a call to TBufferedReadTransport::read(...)
one full message - both
fixed-length header and bytes - is read from the wrapped channel and buffered.
Subsequent read calls are serviced from the internal buffer until it is
exhausted, at which point the next full message is read from the wrapped
channel.
Examples
Create and use a TBufferedReadTransport
.
use std::io::Read;
use thrift::transport::{TBufferedReadTransport, TTcpChannel};
let mut c = TTcpChannel::new();
c.open("localhost:9090").unwrap();
let mut t = TBufferedReadTransport::new(c);
t.read(&mut vec![0u8; 1]).unwrap();
Implementations
pub fn new(channel: C) -> TBufferedReadTransport<C>ⓘNotable traits for TBufferedReadTransport<C>impl<C> Read for TBufferedReadTransport<C> where
C: Read,
pub fn new(channel: C) -> TBufferedReadTransport<C>ⓘNotable traits for TBufferedReadTransport<C>impl<C> Read for TBufferedReadTransport<C> where
C: Read,
impl<C> Read for TBufferedReadTransport<C> where
C: Read,
Create a TBufferedTransport
with default-sized internal read and
write buffers that wraps the given TIoChannel
.
pub fn with_capacity(
read_capacity: usize,
channel: C
) -> TBufferedReadTransport<C>ⓘNotable traits for TBufferedReadTransport<C>impl<C> Read for TBufferedReadTransport<C> where
C: Read,
pub fn with_capacity(
read_capacity: usize,
channel: C
) -> TBufferedReadTransport<C>ⓘNotable traits for TBufferedReadTransport<C>impl<C> Read for TBufferedReadTransport<C> where
C: Read,
impl<C> Read for TBufferedReadTransport<C> where
C: Read,
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
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Like read
, except that it reads into a slice of buffers. Read more
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
Read all bytes until EOF in this source, placing them into buf
. Read more
Read all bytes until EOF in this source, appending them to buf
. Read more
Read the exact number of bytes required to fill buf
. Read more
Creates a “by reference” adapter for this instance of Read
. Read more
Creates an adapter which will chain this stream with another. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for TBufferedReadTransport<C> where
C: RefUnwindSafe,
impl<C> Send for TBufferedReadTransport<C> where
C: Send,
impl<C> Sync for TBufferedReadTransport<C> where
C: Sync,
impl<C> Unpin for TBufferedReadTransport<C> where
C: Unpin,
impl<C> UnwindSafe for TBufferedReadTransport<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Reads an unsigned 8 bit integer from the underlying reader. Read more
Reads a signed 8 bit integer from the underlying reader. Read more
Reads an unsigned 16 bit integer from the underlying reader. Read more
Reads a signed 16 bit integer from the underlying reader. Read more
Reads an unsigned 24 bit integer from the underlying reader. Read more
Reads a signed 24 bit integer from the underlying reader. Read more
Reads an unsigned 32 bit integer from the underlying reader. Read more
Reads a signed 32 bit integer from the underlying reader. Read more
Reads an unsigned 48 bit integer from the underlying reader. Read more
Reads a signed 48 bit integer from the underlying reader. Read more
Reads an unsigned 64 bit integer from the underlying reader. Read more
Reads a signed 64 bit integer from the underlying reader. Read more
Reads an unsigned 128 bit integer from the underlying reader. Read more
Reads a signed 128 bit integer from the underlying reader. Read more
Reads an unsigned n-bytes integer from the underlying reader. Read more
Reads a signed n-bytes integer from the underlying reader. Read more
Reads an unsigned n-bytes integer from the underlying reader.
Reads a signed n-bytes integer from the underlying reader.
Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more
Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more
Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more
Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more
Reads a sequence of signed 8 bit integers from the underlying reader. Read more
Reads a sequence of signed 16 bit integers from the underlying reader. Read more
Reads a sequence of signed 32 bit integers from the underlying reader. Read more
Reads a sequence of signed 64 bit integers from the underlying reader. Read more
Reads a sequence of signed 128 bit integers from the underlying reader. Read more
Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more
Reads a sequence of IEEE754 double-precision (8 bytes) floating point numbers from the underlying reader. Read more