MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / as_slice

Method as_slice

block/src/qcow_common.rs:128–132  ·  view source on GitHub ↗
(&self, len: usize)

Source from the content-addressed store, hash-verified

126 }
127
128 pub fn as_slice(&self, len: usize) -> &[u8] {
129 let len = len.min(self.layout.size());
130 // SAFETY: ptr is valid for layout.size() bytes; len <= layout.size().
131 unsafe { slice::from_raw_parts(self.ptr, len) }
132 }
133
134 #[cfg(test)]
135 pub fn layout(&self) -> &Layout {

Callers 15

setup_mptableFunction · 0.80
tdvf_descriptor_offsetFunction · 0.80
get_configMethod · 0.80
read_transportMethod · 0.80
bytesMethod · 0.80
bytesMethod · 0.80
create_acpi_tablesFunction · 0.80
cmdline_additionsMethod · 0.80
write_headerMethod · 0.80
write_noteMethod · 0.80
write_loadMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by 4

test_push_wrapFunction · 0.64
test_push_errorFunction · 0.64