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

Method write

crates/wiggle/src/lib.rs:79–84  ·  view source on GitHub ↗

Writes the `val` provided to the `ptr` provided. This commit will write a `val` into a guest's linear memory. This will delegate to `T`'s implementation of `write`. # Errors An error is returned if `ptr` is out of bounds, misaligned, or otherwise not valid to read from.

(&mut self, ptr: GuestPtr<T>, val: T)

Source from the content-addressed store, hash-verified

77 /// An error is returned if `ptr` is out of bounds, misaligned, or otherwise
78 /// not valid to read from.
79 pub fn write<T>(&mut self, ptr: GuestPtr<T>, val: T) -> Result<(), GuestError>
80 where
81 T: GuestType,
82 {
83 T::write(self, ptr, val)
84 }
85
86 /// Acquires a slice or owned copy of the memory pointed to by `ptr`.
87 ///

Callers 15

bench_callsFunction · 0.45
newMethod · 0.45
build_wasmFunction · 0.45
preview2_stdinFunction · 0.45
native_loads_and_storesFunction · 0.45
gdb_with_scriptFunction · 0.45
lldb_with_scriptFunction · 0.45
resumeMethod · 0.45
resumeMethod · 0.45

Calls 1

writeFunction · 0.50

Tested by 15

build_wasmFunction · 0.36
preview2_stdinFunction · 0.36
pointers_and_enumsMethod · 0.36
testMethod · 0.36
populate_excusesMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36