[][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]

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]

impl<'_> Read for BasedBufTranche<'_>[src]