Skip to content

Commit 5a15758

Browse files
committed
Expose unread bytes of a slice
Fixes #300
1 parent 2bef91e commit 5a15758

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rmp-serde/src/decode.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,13 @@ pub struct ReadRefReader<'a, R: ?Sized> {
968968
buf: &'a [u8],
969969
}
970970

971+
impl<'a, T> ReadRefReader<'a, T> {
972+
/// Returns the part that hasn't been consumed yet
973+
pub fn remaining_slice(&self) -> &'a [u8] {
974+
self.buf
975+
}
976+
}
977+
971978
impl<'a, T: AsRef<[u8]> + ?Sized> ReadRefReader<'a, T> {
972979
#[inline]
973980
fn new(rd: &'a T) -> Self {

0 commit comments

Comments
 (0)