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

Function c_string

packages/server/src/simulators/session.rs:545–558  ·  view source on GitHub ↗
(ptr: *const i8)

Source from the content-addressed store, hash-verified

543}
544
545fn c_string(ptr: *const i8) -> Option<String> {
546 if ptr.is_null() {
547 return None;
548 }
549 let value = unsafe { std::ffi::CStr::from_ptr(ptr) }
550 .to_string_lossy()
551 .trim()
552 .to_owned();
553 if value.is_empty() {
554 None
555 } else {
556 Some(value)
557 }
558}
559
560fn now_ms() -> u64 {
561 SystemTime::now()

Callers 1

handle_frameMethod · 0.85

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected