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

Method create_session

packages/server/src/native/bridge.rs:861–872  ·  view source on GitHub ↗
(&self, udid: &str)

Source from the content-addressed store, hash-verified

859 }
860
861 pub fn create_session(&self, udid: &str) -> Result<NativeSession, AppError> {
862 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;
863 unsafe {
864 let mut error = ptr::null_mut();
865 let handle = ffi::xcw_native_session_create(udid.as_ptr(), &mut error);
866 if handle.is_null() {
867 return Err(take_error(error)
868 .unwrap_or_else(|| AppError::native("Unable to create native session.")));
869 }
870 Ok(NativeSession { handle })
871 }
872 }
873}
874
875fn optional_c_string(value: Option<&str>) -> Result<Option<CString>, AppError> {

Callers 1

newMethod · 0.80

Calls 2

take_errorFunction · 0.85

Tested by

no test coverage detected