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

Function string_from_raw

packages/server/src/native/bridge.rs:1345–1352  ·  view source on GitHub ↗
(raw: *mut i8, error: *mut i8)

Source from the content-addressed store, hash-verified

1343}
1344
1345unsafe fn string_from_raw(raw: *mut i8, error: *mut i8) -> Result<String, AppError> {
1346 if raw.is_null() {
1347 return Err(take_error(error).unwrap_or_else(|| AppError::native("Unknown native error.")));
1348 }
1349 let value = CStr::from_ptr(raw).to_string_lossy().into_owned();
1350 ffi::xcw_native_free_string(raw);
1351 Ok(value)
1352}
1353
1354unsafe fn bool_result(result: bool, error: *mut i8) -> Result<(), AppError> {
1355 if result {

Callers 9

list_simulatorsMethod · 0.85
create_simulatorMethod · 0.85
chrome_profileMethod · 0.85
recent_logsMethod · 0.85
pasteboard_textMethod · 0.85
video_encoder_statsMethod · 0.85

Calls 2

take_errorFunction · 0.85
xcw_native_free_stringFunction · 0.85

Tested by

no test coverage detected