[−][src]Type Definition tranche::BasedBufTranche
type BasedBufTranche<'a> = BasedTranche<'a, u8>;
A based tranche of bytes, equipped with many convenience methods.
This type implements std::io::Read
and std::io::BufRead
when the std
feature is enabled.
Methods
impl<'a> BasedBufTranche<'a>
[src]
pub fn take_front_as<T>(
&mut self,
n: usize
) -> Result<Tranche<'a, T>, UnexpectedEndError> where
T: AlwaysAligned + AlwaysValid + Immutable,
[src]
&mut self,
n: usize
) -> Result<Tranche<'a, T>, UnexpectedEndError> where
T: AlwaysAligned + AlwaysValid + Immutable,
impl<'_> BasedBufTranche<'_>
[src]
pub fn take_u8(&mut self) -> Result<u8, UnexpectedEndError>
[src]
Takes the first u8
out of the tranche.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i8(&mut self) -> Result<i8, UnexpectedEndError>
[src]
Takes the first i8
out of the tranche.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u16_ne(&mut self) -> Result<u16, UnexpectedEndError>
[src]
Returns a
u16
by taking the first
mem::size_of::<u16>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u16_le(&mut self) -> Result<u16, UnexpectedEndError>
[src]
Returns a
u16
by taking the first
mem::size_of::<u16>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u16_be(&mut self) -> Result<u16, UnexpectedEndError>
[src]
Returns a
u16
by taking the first
mem::size_of::<u16>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i16_ne(&mut self) -> Result<i16, UnexpectedEndError>
[src]
Returns a
i16
by taking the first
mem::size_of::<i16>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i16_le(&mut self) -> Result<i16, UnexpectedEndError>
[src]
Returns a
i16
by taking the first
mem::size_of::<i16>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i16_be(&mut self) -> Result<i16, UnexpectedEndError>
[src]
Returns a
i16
by taking the first
mem::size_of::<i16>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u32_ne(&mut self) -> Result<u32, UnexpectedEndError>
[src]
Returns a
u32
by taking the first
mem::size_of::<u32>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u32_le(&mut self) -> Result<u32, UnexpectedEndError>
[src]
Returns a
u32
by taking the first
mem::size_of::<u32>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u32_be(&mut self) -> Result<u32, UnexpectedEndError>
[src]
Returns a
u32
by taking the first
mem::size_of::<u32>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i32_ne(&mut self) -> Result<i32, UnexpectedEndError>
[src]
Returns a
i32
by taking the first
mem::size_of::<i32>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i32_le(&mut self) -> Result<i32, UnexpectedEndError>
[src]
Returns a
i32
by taking the first
mem::size_of::<i32>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i32_be(&mut self) -> Result<i32, UnexpectedEndError>
[src]
Returns a
i32
by taking the first
mem::size_of::<i32>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u64_ne(&mut self) -> Result<u64, UnexpectedEndError>
[src]
Returns a
u64
by taking the first
mem::size_of::<u64>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u64_le(&mut self) -> Result<u64, UnexpectedEndError>
[src]
Returns a
u64
by taking the first
mem::size_of::<u64>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u64_be(&mut self) -> Result<u64, UnexpectedEndError>
[src]
Returns a
u64
by taking the first
mem::size_of::<u64>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i64_ne(&mut self) -> Result<i64, UnexpectedEndError>
[src]
Returns a
i64
by taking the first
mem::size_of::<i64>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i64_le(&mut self) -> Result<i64, UnexpectedEndError>
[src]
Returns a
i64
by taking the first
mem::size_of::<i64>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i64_be(&mut self) -> Result<i64, UnexpectedEndError>
[src]
Returns a
i64
by taking the first
mem::size_of::<i64>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u128_ne(&mut self) -> Result<u128, UnexpectedEndError>
[src]
Returns a
u128
by taking the first
mem::size_of::<u128>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u128_le(&mut self) -> Result<u128, UnexpectedEndError>
[src]
Returns a
u128
by taking the first
mem::size_of::<u128>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_u128_be(&mut self) -> Result<u128, UnexpectedEndError>
[src]
Returns a
u128
by taking the first
mem::size_of::<u128>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i128_ne(&mut self) -> Result<i128, UnexpectedEndError>
[src]
Returns a
i128
by taking the first
mem::size_of::<i128>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i128_le(&mut self) -> Result<i128, UnexpectedEndError>
[src]
Returns a
i128
by taking the first
mem::size_of::<i128>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_i128_be(&mut self) -> Result<i128, UnexpectedEndError>
[src]
Returns a
i128
by taking the first
mem::size_of::<i128>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_usize_ne(&mut self) -> Result<usize, UnexpectedEndError>
[src]
Returns a
usize
by taking the first
mem::size_of::<usize>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_usize_le(&mut self) -> Result<usize, UnexpectedEndError>
[src]
Returns a
usize
by taking the first
mem::size_of::<usize>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_usize_be(&mut self) -> Result<usize, UnexpectedEndError>
[src]
Returns a
usize
by taking the first
mem::size_of::<usize>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_isize_ne(&mut self) -> Result<isize, UnexpectedEndError>
[src]
Returns a
isize
by taking the first
mem::size_of::<isize>()
bytes out of the tranche in
native
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_isize_le(&mut self) -> Result<isize, UnexpectedEndError>
[src]
Returns a
isize
by taking the first
mem::size_of::<isize>()
bytes out of the tranche in
little
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
pub fn take_isize_be(&mut self) -> Result<isize, UnexpectedEndError>
[src]
Returns a
isize
by taking the first
mem::size_of::<isize>()
bytes out of the tranche in
big
endian order.
The internal offset is incremented accordingly.
Returns Err(_)
if self
is not long enough.
Trait Implementations
impl<'_> BufRead for BasedBufTranche<'_>
[src]
fn fill_buf(&mut self) -> Result<&[u8]>
[src]
fn consume(&mut self, len: usize)
[src]
fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn split(self, byte: u8) -> Split<Self>
1.0.0[src]
fn lines(self) -> Lines<Self>
1.0.0[src]
impl<'_> Read for BasedBufTranche<'_>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
fn is_read_vectored(&self) -> bool
[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,