| 1 | #![cfg(not(feature = "std"))] |
| 2 | use crate::bytestream::{ZByteIoError, ZByteReaderTrait, ZCursor, ZSeekFrom}; |
| 3 | |
| 4 | impl<T: AsRef<[u8]>> ZByteReaderTrait for ZCursor<T> { |
| 5 | #[inline(always)] |
| 6 | fn read_byte_no_error(&mut self) -> u8 { |
| 7 | self.read_byte_no_error_impl() |
| 8 | } |
| 9 | #[inline(always)] |
| 10 | fn read_exact_bytes(&mut self, buf: &mut [u8]) -> Result<(), ZByteIoError> { |
| 11 | self.read_exact_bytes_impl(buf) |
| 12 | } |
| 13 | |
| 14 | fn read_const_bytes<const N: usize>(&mut self, buf: &mut [u8; N]) -> Result<(), ZByteIoError> { |
| 15 | self.read_const_bytes_impl::<N>(buf) |
| 16 | } |
| 17 | |
| 18 | fn read_const_bytes_no_error<const N: usize>(&mut self, buf: &mut [u8; N]) { |
| 19 | self.read_const_bytes_no_error_impl::<N>(buf) |
| 20 | } |
| 21 | |
| 22 | #[inline(always)] |
| 23 | fn read_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError> { |
| 24 | self.read_bytes_impl(buf) |
| 25 | } |
| 26 | |
| 27 | #[inline(always)] |
| 28 | fn peek_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError> { |
| 29 | self.peek_bytes_impl(buf) |
| 30 | } |
| 31 | |
| 32 | #[inline(always)] |
| 33 | fn peek_exact_bytes(&mut self, buf: &mut [u8]) -> Result<(), ZByteIoError> { |
| 34 | self.peek_exact_bytes_impl(buf) |
| 35 | } |
| 36 | |
| 37 | #[inline(always)] |
| 38 | fn z_seek(&mut self, from: ZSeekFrom) -> Result<u64, ZByteIoError> { |
| 39 | self.z_seek_impl(from) |
| 40 | } |
| 41 | |
| 42 | #[inline(always)] |
| 43 | fn is_eof(&mut self) -> Result<bool, ZByteIoError> { |
| 44 | self.is_eof_impl() |
| 45 | } |
| 46 | #[inline(always)] |
| 47 | fn z_position(&mut self) -> Result<u64, ZByteIoError> { |
| 48 | self.z_position_impl() |
| 49 | } |
| 50 | |
| 51 | fn read_remaining(&mut self, sink: &mut alloc::vec::Vec<u8>) -> Result<usize, ZByteIoError> { |
| 52 | self.read_remaining_impl(sink) |
| 53 | } |
| 54 | } |