(&self)
| 40 | /// Return current cursor position, i.e. how many bytes were read from the buffer. |
| 41 | #[inline(always)] |
| 42 | pub fn get_pos(&self) -> usize { |
| 43 | let pos = self.buffer[0]; |
| 44 | if pos == 0 || pos > BS::U8 { |
| 45 | debug_assert!(false); |
| 46 | // SAFETY: `pos` never breaks the invariant |
| 47 | unsafe { |
| 48 | core::hint::unreachable_unchecked(); |
| 49 | } |
| 50 | } |
| 51 | pos as usize |
| 52 | } |
| 53 | |
| 54 | /// Return size of the internal buffer in bytes. |
| 55 | #[inline(always)] |
no outgoing calls
no test coverage detected