ByteStream

Struct ByteStream 

Source
pub struct ByteStream {
    pub cursor: Cursor<Vec<u8>>,
    pub offset: usize,
    pub length: usize,
    pub message: String,
}

Fields§

§cursor: Cursor<Vec<u8>>§offset: usize§length: usize§message: String

Implementations§

Source§

impl ByteStream

Source§

impl ByteStream

Source

pub fn read_byte(&mut self) -> Result<u8, ByteStreamError>

Source

pub fn read_bool(&mut self) -> Result<(bool, u8), ByteStreamError>

Source

pub fn read_bytes(&mut self, n: usize) -> Result<Vec<u8>, ByteStreamError>

Source

pub fn read_int8(&mut self) -> Result<i8, ByteStreamError>

Source

pub fn read_uint8(&mut self) -> Result<u8, ByteStreamError>

Source

pub fn read_int16(&mut self) -> Result<i16, ByteStreamError>

Source

pub fn read_uint16(&mut self) -> Result<u16, ByteStreamError>

Source

pub fn read_int24(&mut self) -> Result<i32, ByteStreamError>

Source

pub fn read_uint24(&mut self) -> Result<u32, ByteStreamError>

Source

pub fn read_int32(&mut self) -> Result<i32, ByteStreamError>

Source

pub fn read_int32_le(&mut self) -> Result<i32, ByteStreamError>

Source

pub fn read_uint32(&mut self) -> Result<u32, ByteStreamError>

Source

pub fn read_int64(&mut self) -> Result<i64, ByteStreamError>

Source

pub fn read_uint64(&mut self) -> Result<u64, ByteStreamError>

Source

pub fn read_vint(&mut self) -> Result<i64, ByteStreamError>

Source

pub fn read_long(&mut self) -> Result<i64, ByteStreamError>

Source

pub fn read_ulong(&mut self) -> Result<u64, ByteStreamError>

Source

pub fn read_longlong(&mut self) -> Result<i64, ByteStreamError>

Source

pub fn read_ulonglong(&mut self) -> Result<u64, ByteStreamError>

Source

pub fn read_string(&mut self) -> Result<String, ByteStreamError>

Source

pub fn read_string_reference(&mut self) -> Result<String, ByteStreamError>

Source

pub fn read_string_size( &mut self, size: usize, ) -> Result<String, ByteStreamError>

Source

pub fn read_compressed_string(&mut self) -> Result<String, ByteStreamError>

Source

pub fn read_logic_long(&mut self) -> Result<LogicLong, ByteStreamError>

Source§

impl ByteStream

Source

pub fn write_byte(&mut self, byte: u8) -> Result<(), ByteStreamError>

Source

pub fn write_bool( &mut self, value: u8, bool: bool, ) -> Result<(), ByteStreamError>

Source

pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), ByteStreamError>

Source

pub fn write_int8(&mut self, int8: i8) -> Result<(), ByteStreamError>

Source

pub fn write_uint8(&mut self, uint8: u8) -> Result<(), ByteStreamError>

Source

pub fn write_int16(&mut self, int16: i16) -> Result<(), ByteStreamError>

Source

pub fn write_uint16(&mut self, uint16: u16) -> Result<(), ByteStreamError>

Source

pub fn write_int24(&mut self, int24: i32) -> Result<(), ByteStreamError>

Source

pub fn write_uint24(&mut self, uint24: u32) -> Result<(), ByteStreamError>

Source

pub fn write_int32(&mut self, int32: i32) -> Result<(), ByteStreamError>

Source

pub fn write_int32_le(&mut self, int32: i32) -> Result<(), ByteStreamError>

Source

pub fn write_uint32(&mut self, uint32: u32) -> Result<(), ByteStreamError>

Source

pub fn write_int64(&mut self, int64: i64) -> Result<(), ByteStreamError>

Source

pub fn write_uint64(&mut self, uint64: u64) -> Result<(), ByteStreamError>

Source

pub fn write_vint(&mut self, vint: i64) -> Result<(), ByteStreamError>

Source

pub fn write_long(&mut self, long: i64) -> Result<(), ByteStreamError>

Source

pub fn write_ulong(&mut self, ulong: u64) -> Result<(), ByteStreamError>

Source

pub fn write_longlong(&mut self, longlong: i64) -> Result<(), ByteStreamError>

Source

pub fn write_ulonglong(&mut self, ulonglong: u64) -> Result<(), ByteStreamError>

Source

pub fn write_string(&mut self, string: String) -> Result<(), ByteStreamError>

Source

pub fn write_string_reference( &mut self, string: String, ) -> Result<(), ByteStreamError>

Source

pub fn write_string_size( &mut self, size: usize, string: String, ) -> Result<(), ByteStreamError>

Source

pub fn write_string_size_reference( &mut self, size: usize, string: String, ) -> Result<(), ByteStreamError>

Source

pub fn write_compressed_string( &mut self, string: String, ) -> Result<(), ByteStreamError>

Source

pub fn write_logic_long( &mut self, logic_long: LogicLong, ) -> Result<(), ByteStreamError>

Trait Implementations§

Source§

impl Debug for ByteStream

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V