MCPcopy Create free account
hub / github.com/RustCrypto/utils / get_pos

Method get_pos

block-buffer/src/read.rs:42–52  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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)]

Callers 3

remainingMethod · 0.45
read_cachedMethod · 0.45
serializeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected