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

Method get_data

block-buffer/src/lib.rs:250–254  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

248 /// Return slice of data stored inside the buffer.
249 #[inline(always)]
250 pub fn get_data(&self) -> &[u8] {
251 // SAFETY: the `buffer` field is properly initialized up to `self.get_pos()`.
252 // `get_pos` never returns position bigger than buffer size.
253 unsafe { slice::from_raw_parts(self.buffer.as_ptr().cast(), self.get_pos()) }
254 }
255
256 /// Set buffer content and cursor position.
257 ///

Callers 3

fmtMethod · 0.80
pad_with_zerosMethod · 0.80
serializeMethod · 0.80

Calls 1

get_posMethod · 0.45

Tested by

no test coverage detected