MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / copy_from_slice

Method copy_from_slice

crates/wasmtime/src/runtime/vm/gc/data.rs:207–219  ·  view source on GitHub ↗
(&mut self, offset: u32, src: &[u8])

Source from the content-addressed store, hash-verified

205 /// Returns an error on out-of-bounds accesses.
206 #[inline]
207 pub fn copy_from_slice(&mut self, offset: u32, src: &[u8]) -> Result<()> {
208 let offset = usize::try_from(offset)?;
209 let into = match self
210 .data
211 .get_mut(offset..)
212 .and_then(|s| s.get_mut(..src.len()))
213 {
214 Some(into) => into,
215 None => bail_bug!("out of bounds copy"),
216 };
217 into.copy_from_slice(src);
218 Ok(())
219 }
220
221 /// Copy within this this object's data.
222 ///

Callers 15

write_bytesFunction · 0.45
fd_readMethod · 0.45
fd_preadMethod · 0.45
get_outputMethod · 0.45
loadMethod · 0.45
set_inputMethod · 0.45
computeMethod · 0.45
write_bytesMethod · 0.45
patchMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
prepare_callMethod · 0.45

Calls 3

OkFunction · 0.85
get_mutMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected