File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -736,6 +736,20 @@ impl<T :io::Read + io::Seek> PacketReader<T> {
736736 pub fn into_inner ( self ) -> T {
737737 self . rdr
738738 }
739+ /// Returns a reference to the wrapped reader.
740+ pub const fn get_ref ( & self ) -> & T {
741+ & self . rdr
742+ }
743+ /// Returns a mutable reference to the wrapped reader.
744+ ///
745+ /// # Safety
746+ ///
747+ /// Care should be taken to avoid modifying the internal state of the wrapped reader,
748+ /// as it may corrupt the state of the `PacketReader`. It is the caller's responsibility
749+ /// to ensure that the data remains consistent when using this function.
750+ pub fn get_mut ( & mut self ) -> & mut T {
751+ & mut self . rdr
752+ }
739753 /// Reads a packet, and returns it on success.
740754 ///
741755 /// Ok(None) is returned if the physical stream has ended.
You can’t perform that action at this time.
0 commit comments