mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
[Protocol] Add buffer comment to refactor at some point remaining_bytes
This commit is contained in:
parent
9d8fb1ba94
commit
071fc367df
2 changed files with 4 additions and 3 deletions
|
|
@ -46,8 +46,9 @@ impl<'a, B: ByteOrder> Buffer<'a, B> {
|
|||
/// Returns the length of the buffer data.
|
||||
pub const fn data_length(&self) -> usize { self.data.len() }
|
||||
|
||||
// Added for legacy support just for the refactoring
|
||||
// Not Tested
|
||||
// TODO: Look into this to make it take ownership of data, not borrowing it
|
||||
// There are many instances where we transform this to a vector.
|
||||
/// Returns the remaining bytes that have not been read.
|
||||
pub fn remaining_bytes(&self) -> &[u8] { &self.data[self.cursor ..] }
|
||||
|
||||
/// Moves the cursor forward or backward by a specified offset.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue