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: StringImplementations§
Source§impl ByteStream
impl ByteStream
pub fn new_from_buffer(buffer: Vec<u8>) -> ByteStream
pub fn new() -> ByteStream
Source§impl ByteStream
impl ByteStream
pub fn read_byte(&mut self) -> Result<u8, ByteStreamError>
pub fn read_bool(&mut self) -> Result<(bool, u8), ByteStreamError>
pub fn read_bytes(&mut self, n: usize) -> Result<Vec<u8>, ByteStreamError>
pub fn read_int8(&mut self) -> Result<i8, ByteStreamError>
pub fn read_uint8(&mut self) -> Result<u8, ByteStreamError>
pub fn read_int16(&mut self) -> Result<i16, ByteStreamError>
pub fn read_uint16(&mut self) -> Result<u16, ByteStreamError>
pub fn read_int24(&mut self) -> Result<i32, ByteStreamError>
pub fn read_uint24(&mut self) -> Result<u32, ByteStreamError>
pub fn read_int32(&mut self) -> Result<i32, ByteStreamError>
pub fn read_int32_le(&mut self) -> Result<i32, ByteStreamError>
pub fn read_uint32(&mut self) -> Result<u32, ByteStreamError>
pub fn read_int64(&mut self) -> Result<i64, ByteStreamError>
pub fn read_uint64(&mut self) -> Result<u64, ByteStreamError>
pub fn read_vint(&mut self) -> Result<i64, ByteStreamError>
pub fn read_long(&mut self) -> Result<i64, ByteStreamError>
pub fn read_ulong(&mut self) -> Result<u64, ByteStreamError>
pub fn read_longlong(&mut self) -> Result<i64, ByteStreamError>
pub fn read_ulonglong(&mut self) -> Result<u64, ByteStreamError>
pub fn read_string(&mut self) -> Result<String, ByteStreamError>
pub fn read_string_reference(&mut self) -> Result<String, ByteStreamError>
pub fn read_string_size( &mut self, size: usize, ) -> Result<String, ByteStreamError>
pub fn read_compressed_string(&mut self) -> Result<String, ByteStreamError>
pub fn read_logic_long(&mut self) -> Result<LogicLong, ByteStreamError>
Source§impl ByteStream
impl ByteStream
pub fn write_byte(&mut self, byte: u8) -> Result<(), ByteStreamError>
pub fn write_bool( &mut self, value: u8, bool: bool, ) -> Result<(), ByteStreamError>
pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), ByteStreamError>
pub fn write_int8(&mut self, int8: i8) -> Result<(), ByteStreamError>
pub fn write_uint8(&mut self, uint8: u8) -> Result<(), ByteStreamError>
pub fn write_int16(&mut self, int16: i16) -> Result<(), ByteStreamError>
pub fn write_uint16(&mut self, uint16: u16) -> Result<(), ByteStreamError>
pub fn write_int24(&mut self, int24: i32) -> Result<(), ByteStreamError>
pub fn write_uint24(&mut self, uint24: u32) -> Result<(), ByteStreamError>
pub fn write_int32(&mut self, int32: i32) -> Result<(), ByteStreamError>
pub fn write_int32_le(&mut self, int32: i32) -> Result<(), ByteStreamError>
pub fn write_uint32(&mut self, uint32: u32) -> Result<(), ByteStreamError>
pub fn write_int64(&mut self, int64: i64) -> Result<(), ByteStreamError>
pub fn write_uint64(&mut self, uint64: u64) -> Result<(), ByteStreamError>
pub fn write_vint(&mut self, vint: i64) -> Result<(), ByteStreamError>
pub fn write_long(&mut self, long: i64) -> Result<(), ByteStreamError>
pub fn write_ulong(&mut self, ulong: u64) -> Result<(), ByteStreamError>
pub fn write_longlong(&mut self, longlong: i64) -> Result<(), ByteStreamError>
pub fn write_ulonglong(&mut self, ulonglong: u64) -> Result<(), ByteStreamError>
pub fn write_string(&mut self, string: String) -> Result<(), ByteStreamError>
pub fn write_string_reference( &mut self, string: String, ) -> Result<(), ByteStreamError>
pub fn write_string_size( &mut self, size: usize, string: String, ) -> Result<(), ByteStreamError>
pub fn write_string_size_reference( &mut self, size: usize, string: String, ) -> Result<(), ByteStreamError>
pub fn write_compressed_string( &mut self, string: String, ) -> Result<(), ByteStreamError>
pub fn write_logic_long( &mut self, logic_long: LogicLong, ) -> Result<(), ByteStreamError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ByteStream
impl RefUnwindSafe for ByteStream
impl Send for ByteStream
impl Sync for ByteStream
impl Unpin for ByteStream
impl UnwindSafe for ByteStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more