Struct binreader::SliceRefBinReader [−][src]
pub struct SliceRefBinReader<'r> { /* fields omitted */ }
Expand description
Trait Implementations
Generates a new BinReader
using the provided slice, initial offset, and endidness. While
the exact implementation of this varies from implementation to implementation,
OwnableBinReader
s will, more than likely, copy the data in the slice. Read more
The amount of data in the reader. If the reader’s size changes (which none of the implementations currently do), then this should return how much data was initially in the reader. Read more
The amount of data left, based off of the BinReader::current_offset
.
The current offset of the reader’s cursor.
Changes the default endidness.
Sets the reader’s BinReader::current_offset
.
Alters the BinReader::current_offset
by the given amount.
Functions the same as the BinReader::from_slice_with_offset
, except the initial offset
is always 0
. Read more
The lowest valid offset that can be requested. By default, this is the same as
BinReader::initial_offset
. Read more
The highest valid offset that can be requested. By default, this is the reader’s
BinReader::size
plus its BinReader::initial_offset
. Read more
Checks whether or not there is any data left, based off of the
BinReader::current_offset
. Read more
A helper method that validates an offset (mostly used by reader implementations). Read more
Takes an absolute offset and converts it to a relative offset, based off of the
BinReader::current_offset
. Read more
Returns true
if the next bytes are the same as the ones provided.
Fills the provided buffer with bytes, starting at the provided offset. This does not alter
the BinReader::current_offset
. Read more
Returns a subsequence (i.e. a &[u8]
) of data of the requested size beginning at the
provided offset. Read more
Returns a slice of the data between the provided starting and ending offsets.
Fills the provided buffer with the next n bytes, where n is the length of the buffer. This
then advances the BinReader::current_offset
by n. Read more
Gets the u8
at the BinReader::current_offset
without altering the
BinReader::current_offset
. Read more
Gets the nelong endian i8
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian u16
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian u16
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian i16
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian i16
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian u32
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian u32
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian i32
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian i32
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian u64
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian u64
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian i64
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian i64
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian u128
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian u128
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the belong endian i128
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the lelong endian i128
at the BinReader::current_offset
without
altering the BinReader::current_offset
. Read more
Gets the u8
at the provided offset without altering the BinReader::current_offset
.
Gets the nelong endian i8
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian u16
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian u16
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian i16
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian i16
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian u32
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian u32
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian i32
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian i32
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian u64
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian u64
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian i64
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian i64
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian u128
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian u128
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the belong endian i128
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the lelong endian i128
at the provided offset without altering the
BinReader::current_offset
. Read more
Gets the u16
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the u32
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the u64
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the u128
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the i16
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the i32
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the i64
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the i128
using the default endidness at the provided offset without altering the
BinReader::current_offset
. If the current endidness is Endidness::Unknown
, then an
error is returned. Read more
Gets the nelong endian i8
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian u16
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian u16
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian i16
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian i16
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian u32
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian u32
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian i32
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian i32
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian u64
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian u64
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian i64
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian i64
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian u128
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian u128
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the belong endian i128
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the lelong endian i128
at the BinReader::current_offset
and then
advances it by 1
. Read more
Gets the u16
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the u16
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the u16
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the u16
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the i8
at the BinReader::current_offset
and then advances it by 1
. If the
current endidness is Endidness::Unknown
, then an error is returned. Read more
Gets the i16
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the i32
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the i64
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
Gets the i128
using the default endidness at the BinReader::current_offset
and then
advances it by 1
. If the current endidness is Endidness::Unknown
, then an error is
returned. Read more
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” adaptor for this instance of Read
. Read more
Creates an adaptor which will chain this stream with another. Read more
fn next_n_bytes_as_reader_retain_offset(
&mut self,
num_bytes: usize
) -> Result<SliceRefBinReader<'_>>
fn slice_reader_with_offset(
&self,
start: usize,
offset: usize,
end: usize
) -> Result<SliceRefBinReader<'_>>
fn slice_reader_retain_offset(
&self,
start: usize,
end: usize
) -> Result<SliceRefBinReader<'_>>
Auto Trait Implementations
impl<'r> !RefUnwindSafe for SliceRefBinReader<'r>
impl<'r> Send for SliceRefBinReader<'r>
impl<'r> !Sync for SliceRefBinReader<'r>
impl<'r> Unpin for SliceRefBinReader<'r>
impl<'r> UnwindSafe for SliceRefBinReader<'r>