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

Method as_slice

nodedb-wal/src/align.rs:109–112  ·  view source on GitHub ↗

Get the written portion of the buffer as a byte slice. The returned slice starts at an aligned address.

(&self)

Source from the content-addressed store, hash-verified

107 ///
108 /// The returned slice starts at an aligned address.
109 pub fn as_slice(&self) -> &[u8] {
110 // SAFETY: ptr is valid for `len` bytes, and we have shared access.
111 unsafe { std::slice::from_raw_parts(self.ptr, self.len) }
112 }
113
114 /// Get the written portion padded up to the next alignment boundary.
115 ///

Callers 15

large_datasetFunction · 0.45
encodeFunction · 0.45
train_tinyFunction · 0.45
flush_bufferMethod · 0.45

Calls

no outgoing calls