MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / take_native_string

Function take_native_string

packages/server/src/camera.rs:251–255  ·  view source on GitHub ↗
(raw: *mut c_char)

Source from the content-addressed store, hash-verified

249}
250
251fn take_native_string(raw: *mut c_char) -> String {
252 let value = unsafe { CStr::from_ptr(raw).to_string_lossy().into_owned() };
253 unsafe { ffi::xcw_native_free_string(raw) };
254 value
255}
256
257fn cstring(name: &str, value: &str) -> Result<CString, AppError> {
258 CString::new(value).map_err(|_| AppError::bad_request(format!("{name} contains NUL byte.")))

Callers 2

native_jsonFunction · 0.85
native_errorFunction · 0.85

Calls 1

xcw_native_free_stringFunction · 0.85

Tested by

no test coverage detected