diff --git a/api/io/all-features.txt b/api/io/all-features.txt index aef13ac56..af10dd887 100644 --- a/api/io/all-features.txt +++ b/api/io/all-features.txt @@ -214,6 +214,8 @@ pub fn bitcoin_io::BufRead::consume(&mut self, amount: usize) pub fn bitcoin_io::BufRead::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> pub fn bitcoin_io::Cursor::consume(&mut self, amount: usize) pub fn bitcoin_io::Cursor::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> +pub fn bitcoin_io::Cursor::get_mut(&mut self) -> &mut T +pub fn bitcoin_io::Cursor::get_ref(&self) -> &T pub fn bitcoin_io::Cursor::inner(&self) -> &T pub fn bitcoin_io::Cursor::into_inner(self) -> T pub fn bitcoin_io::Cursor::new(inner: T) -> Self diff --git a/api/io/alloc-only.txt b/api/io/alloc-only.txt index b0aaeff4e..572cb17e1 100644 --- a/api/io/alloc-only.txt +++ b/api/io/alloc-only.txt @@ -91,6 +91,8 @@ pub fn bitcoin_io::BufRead::consume(&mut self, amount: usize) pub fn bitcoin_io::BufRead::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> pub fn bitcoin_io::Cursor::consume(&mut self, amount: usize) pub fn bitcoin_io::Cursor::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> +pub fn bitcoin_io::Cursor::get_mut(&mut self) -> &mut T +pub fn bitcoin_io::Cursor::get_ref(&self) -> &T pub fn bitcoin_io::Cursor::inner(&self) -> &T pub fn bitcoin_io::Cursor::into_inner(self) -> T pub fn bitcoin_io::Cursor::new(inner: T) -> Self diff --git a/api/io/no-features.txt b/api/io/no-features.txt index facd4c3ef..93613d4e6 100644 --- a/api/io/no-features.txt +++ b/api/io/no-features.txt @@ -87,6 +87,8 @@ pub fn bitcoin_io::BufRead::consume(&mut self, amount: usize) pub fn bitcoin_io::BufRead::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> pub fn bitcoin_io::Cursor::consume(&mut self, amount: usize) pub fn bitcoin_io::Cursor::fill_buf(&mut self) -> bitcoin_io::Result<&[u8]> +pub fn bitcoin_io::Cursor::get_mut(&mut self) -> &mut T +pub fn bitcoin_io::Cursor::get_ref(&self) -> &T pub fn bitcoin_io::Cursor::inner(&self) -> &T pub fn bitcoin_io::Cursor::into_inner(self) -> T pub fn bitcoin_io::Cursor::new(inner: T) -> Self diff --git a/io/src/lib.rs b/io/src/lib.rs index 9770f6ce8..35e12b631 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -224,6 +224,19 @@ impl> Cursor { /// /// This is the whole wrapped buffer, including the bytes already read. #[inline] + pub fn get_ref(&self) -> &T { &self.inner } + + /// Returns a mutable reference to the inner buffer. + /// + /// This is the whole wrapped buffer, including the bytes already read. + #[inline] + pub fn get_mut(&mut self) -> &mut T { &mut self.inner } + + /// Returns a reference to the inner buffer. + /// + /// This is the whole wrapped buffer, including the bytes already read. + #[inline] + #[deprecated(since = "TBD", note = "use `get_ref()` instead")] pub fn inner(&self) -> &T { &self.inner } }