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

Method set

block-buffer/src/lib.rs:261–269  ·  view source on GitHub ↗
(&mut self, buf: Array<u8, BS>, pos: usize)

Source from the content-addressed store, hash-verified

259 /// If `pos` is bigger or equal to block size.
260 #[inline]
261 pub fn set(&mut self, buf: Array<u8, BS>, pos: usize) {
262 assert!(K::invariant(pos, BS::USIZE));
263 self.buffer = MaybeUninit::new(buf);
264 // SAFETY: we have asserted that `pos` satisfies the invariant and
265 // the `buffer` field is fully initialized
266 unsafe {
267 self.set_pos_unchecked(pos);
268 }
269 }
270
271 /// Return size of the internal buffer in bytes.
272 #[inline(always)]

Callers

nothing calls this directly

Calls 1

set_pos_uncheckedMethod · 0.45

Tested by

no test coverage detected