MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / new

Method new

nodedb-wal/src/secure_mem.rs:28–33  ·  view source on GitHub ↗

Wrap a 32-byte key, attempting to mlock it. If mlock fails, logs a warning and continues — startup is not aborted.

(bytes: [u8; 32])

Source from the content-addressed store, hash-verified

26 ///
27 /// If mlock fails, logs a warning and continues — startup is not aborted.
28 pub fn new(bytes: [u8; 32]) -> Self {
29 let mut boxed = Box::new(bytes);
30 #[cfg(all(unix, not(target_arch = "wasm32")))]
31 mlock_best_effort(boxed.as_mut_ptr() as *mut libc::c_void, 32);
32 Self { bytes: boxed }
33 }
34
35 /// Access the key bytes.
36 pub fn as_bytes(&self) -> &[u8; 32] {

Callers

nothing calls this directly

Calls 2

mlock_best_effortFunction · 0.85
as_mut_ptrMethod · 0.45

Tested by

no test coverage detected