MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / write_cstring

Method write_cstring

crates/tinywasm/src/reference.rs:280–282  ·  view source on GitHub ↗

Copies a nul-terminated C string into memory.

(&self, store: &mut Store, offset: usize, string: &CString)

Source from the content-addressed store, hash-verified

278
279 /// Copies a nul-terminated C string into memory.
280 pub fn write_cstring(&self, store: &mut Store, offset: usize, string: &CString) -> Result<()> {
281 self.copy_from_slice(store, offset, string.as_bytes_with_nul())
282 }
283
284 /// Copies a UTF-8 string into memory and appends a trailing nul byte.
285 pub fn write_cstring_bytes(&self, store: &mut Store, offset: usize, string: &str) -> Result<()> {

Callers

nothing calls this directly

Calls 1

copy_from_sliceMethod · 0.45

Tested by

no test coverage detected