Struct protobuf::CodedInputStream [−][src]
pub struct CodedInputStream<'a> { /* fields omitted */ }
Expand description
Buffered read with handy utilities.
Implementations
pub fn new(read: &'a mut dyn Read) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
pub fn new(read: &'a mut dyn Read) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
impl<'a> Read for CodedInputStream<'a>
Wrap a Read
.
Note resulting CodedInputStream
is buffered even if Read
is not.
pub fn from_buffered_reader(
buf_read: &'a mut dyn BufRead
) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
pub fn from_buffered_reader(
buf_read: &'a mut dyn BufRead
) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
impl<'a> Read for CodedInputStream<'a>
Create from BufRead
.
CodedInputStream
will utilize BufRead
buffer.
pub fn from_bytes(bytes: &'a [u8]) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
pub fn from_bytes(bytes: &'a [u8]) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
impl<'a> Read for CodedInputStream<'a>
Read from byte slice
pub fn from_carllerche_bytes(bytes: &'a Bytes) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
pub fn from_carllerche_bytes(bytes: &'a Bytes) -> CodedInputStream<'a>ⓘNotable traits for CodedInputStream<'a>impl<'a> Read for CodedInputStream<'a>
impl<'a> Read for CodedInputStream<'a>
Read from Bytes
.
CodedInputStream
operations like
read_carllerche_bytes
will return a shared copy of this bytes object.
Set the recursion limit.
How many bytes until current limit
Read bytes into given buf
.
Return 0
on EOF.
Read one byte
Push new limit, return previous limit.
Are we at EOF?
Check we are at EOF.
Return error if we are not at EOF.
Read varint
Read varint
Read little-endian 32-bit integer
Read little-endian 64-bit integer
Read tag
Read tag, return it is pair (field number, wire type)
Read double
Read float
Read int64
Read int32
Read uint64
Read uint32
Read sint64
Read sint32
Read fixed64
Read fixed32
Read sfixed64
Read sfixed32
Read bool
Read enum
as ProtobufEnum
pub fn read_repeated_packed_double_into(
&mut self,
target: &mut Vec<f64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_double_into(
&mut self,
target: &mut Vec<f64>
) -> ProtobufResult<()>
Read repeated
packed double
pub fn read_repeated_packed_float_into(
&mut self,
target: &mut Vec<f32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_float_into(
&mut self,
target: &mut Vec<f32>
) -> ProtobufResult<()>
Read repeated
packed float
pub fn read_repeated_packed_int64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_int64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
Read repeated
packed int64
pub fn read_repeated_packed_int32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_int32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
Read repeated packed int32
pub fn read_repeated_packed_uint64_into(
&mut self,
target: &mut Vec<u64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_uint64_into(
&mut self,
target: &mut Vec<u64>
) -> ProtobufResult<()>
Read repeated packed uint64
pub fn read_repeated_packed_uint32_into(
&mut self,
target: &mut Vec<u32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_uint32_into(
&mut self,
target: &mut Vec<u32>
) -> ProtobufResult<()>
Read repeated packed uint32
pub fn read_repeated_packed_sint64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_sint64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
Read repeated packed sint64
pub fn read_repeated_packed_sint32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_sint32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
Read repeated packed sint32
pub fn read_repeated_packed_fixed64_into(
&mut self,
target: &mut Vec<u64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_fixed64_into(
&mut self,
target: &mut Vec<u64>
) -> ProtobufResult<()>
Read repeated packed fixed64
pub fn read_repeated_packed_fixed32_into(
&mut self,
target: &mut Vec<u32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_fixed32_into(
&mut self,
target: &mut Vec<u32>
) -> ProtobufResult<()>
Read repeated packed fixed32
pub fn read_repeated_packed_sfixed64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
pub fn read_repeated_packed_sfixed64_into(
&mut self,
target: &mut Vec<i64>
) -> ProtobufResult<()>
Read repeated packed sfixed64
pub fn read_repeated_packed_sfixed32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
pub fn read_repeated_packed_sfixed32_into(
&mut self,
target: &mut Vec<i32>
) -> ProtobufResult<()>
Read repeated packed sfixed32
pub fn read_repeated_packed_bool_into(
&mut self,
target: &mut Vec<bool>
) -> ProtobufResult<()>
pub fn read_repeated_packed_bool_into(
&mut self,
target: &mut Vec<bool>
) -> ProtobufResult<()>
Read repeated packed bool
pub fn read_repeated_packed_enum_into<E: ProtobufEnum>(
&mut self,
target: &mut Vec<E>
) -> ProtobufResult<()>
pub fn read_repeated_packed_enum_into<E: ProtobufEnum>(
&mut self,
target: &mut Vec<E>
) -> ProtobufResult<()>
Read repeated packed enum
into ProtobufEnum
Read UnknownValue
Skip field
Read raw bytes into the supplied vector. The vector will be resized as needed and overwritten.
Read exact number of bytes
Skip exact number of bytes
Read bytes
field, length delimited
Read bytes
field, length delimited
Read string
field, length delimited
Read bytes
field, length delimited
Read string
field, length delimited
Read string
field, length delimited
Read message, do not check if message is initialized
Read message
Trait Implementations
Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more
Tells this buffer that amt
bytes have been consumed from the buffer,
so they should no longer be returned in calls to read
. Read more
🔬 This is a nightly-only experimental API. (buf_read_has_data_left
)
recently added
Check if the underlying Read
has any data left to be read. Read more
Read all bytes into buf
until the delimiter byte
or EOF is reached. Read more
Read all bytes until a newline (the 0xA
byte) is reached, and append
them to the provided buffer. Read more
Returns an iterator over the contents of this reader split on the byte
byte
. Read more
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