pub struct Reader<'a> { /* private fields */ }Expand description
A forward-only reader over a byte slice. Integers are little endian.
Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
Sourcepub fn read_bytes(&mut self, count: usize) -> Result<Vec<u8>, SteamError>
pub fn read_bytes(&mut self, count: usize) -> Result<Vec<u8>, SteamError>
Reads exactly count bytes and advances the cursor.
Sourcepub fn read_up_to(&mut self, count: usize) -> Vec<u8> ⓘ
pub fn read_up_to(&mut self, count: usize) -> Vec<u8> ⓘ
Reads up to count bytes and advances the cursor. Returns fewer bytes
if the data runs out instead of failing.
Sourcepub fn read_u8(&mut self) -> Result<u8, SteamError>
pub fn read_u8(&mut self) -> Result<u8, SteamError>
Reads a single unsigned byte.
Sourcepub fn read_i8(&mut self) -> Result<i8, SteamError>
pub fn read_i8(&mut self) -> Result<i8, SteamError>
Reads a single signed byte.
Sourcepub fn read_u16(&mut self) -> Result<u16, SteamError>
pub fn read_u16(&mut self) -> Result<u16, SteamError>
Reads a single unsigned 16 bit short.
Sourcepub fn read_i16(&mut self) -> Result<i16, SteamError>
pub fn read_i16(&mut self) -> Result<i16, SteamError>
Reads a single signed 16 bit short.
Sourcepub fn read_u32(&mut self) -> Result<u32, SteamError>
pub fn read_u32(&mut self) -> Result<u32, SteamError>
Reads a single unsigned 32 bit integer.
Sourcepub fn read_i32(&mut self) -> Result<i32, SteamError>
pub fn read_i32(&mut self) -> Result<i32, SteamError>
Reads a single signed 32 bit integer.
Sourcepub fn read_u64(&mut self) -> Result<u64, SteamError>
pub fn read_u64(&mut self) -> Result<u64, SteamError>
Reads a single unsigned 64 bit integer.
Sourcepub fn read_i64(&mut self) -> Result<i64, SteamError>
pub fn read_i64(&mut self) -> Result<i64, SteamError>
Reads a single signed 64 bit integer.
Sourcepub fn read_f32(&mut self) -> Result<f32, SteamError>
pub fn read_f32(&mut self) -> Result<f32, SteamError>
Reads a single 32 bit float.
Sourcepub fn read_f64(&mut self) -> Result<f64, SteamError>
pub fn read_f64(&mut self) -> Result<f64, SteamError>
Reads a single 64 bit double.
Sourcepub fn read_null_term_string(&mut self) -> Result<String, SteamError>
pub fn read_null_term_string(&mut self) -> Result<String, SteamError>
Reads a null-terminated UTF-8 string and consumes the terminator. If there’s no terminator, reads to the end of the data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Reader<'a>
impl<'a> RefUnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnsafeUnpin for Reader<'a>
impl<'a> UnwindSafe for Reader<'a>
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