MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / safe_str_owned

Function safe_str_owned

compiler/src/main/mod.rs:151–153  ·  view source on GitHub ↗

Owned UTF-8 string from an FFI `(ptr, len)`; empty on null or invalid UTF-8. */

(ptr: *const u8, len: u32)

Source from the content-addressed store, hash-verified

149
150/* Owned UTF-8 string from an FFI `(ptr, len)`; empty on null or invalid UTF-8. */
151pub(super) unsafe fn safe_str_owned(ptr: *const u8, len: u32) -> String {
152 core::str::from_utf8(unsafe { safe_bytes(ptr, len) }).unwrap_or("").to_string()
153}
154
155// Release a batch of handles in one runtime borrow.
156pub(super) fn release_handles(handles: &[u32]) {

Callers 4

register_code_moduleFunction · 0.85
register_native_moduleFunction · 0.85
host_edge_opFunction · 0.85
host_edge_throwFunction · 0.85

Calls 1

safe_bytesFunction · 0.85

Tested by

no test coverage detected