Skip to content

Commit

Permalink
Add get_ref() and get_mut()
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Khramtsov committed Jun 20, 2024
1 parent 5ee8316 commit bee14b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/reading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,14 @@ impl<T :io::Read + io::Seek> PacketReader<T> {
pub fn into_inner(self) -> T {
self.rdr
}
/// Returns a reference to the wrapped reader
pub const fn get_ref(&self) -> &T {
&self.rdr
}
/// Returns a mutable reference to the wrapped reader
pub fn get_mut(&mut self) -> &mut T {
&mut self.rdr
}
/// Reads a packet, and returns it on success.
///
/// Ok(None) is returned if the physical stream has ended.
Expand Down

0 comments on commit bee14b0

Please sign in to comment.