(&self, udid: &str)
| 845 | } |
| 846 | |
| 847 | pub fn create_input_session(&self, udid: &str) -> Result<NativeInputSession, AppError> { |
| 848 | let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?; |
| 849 | unsafe { |
| 850 | let mut error = ptr::null_mut(); |
| 851 | let handle = ffi::xcw_native_input_create(udid.as_ptr(), &mut error); |
| 852 | if handle.is_null() { |
| 853 | return Err(take_error(error).unwrap_or_else(|| { |
| 854 | AppError::native("Unable to create native input session.") |
| 855 | })); |
| 856 | } |
| 857 | Ok(NativeInputSession { handle }) |
| 858 | } |
| 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()))?; |
no test coverage detected