Get the current 'context' value for this handle. The context value is an arbitrary value that is always passed back to callbacks to help identify the source
(handle: &Handle)
| 480 | /// The context value is an arbitrary value that is always passed |
| 481 | /// back to callbacks to help identify the source |
| 482 | pub fn context_get(handle: &Handle) -> Result<u64> { |
| 483 | let mut c_context: *mut c_void = &mut 0u64 as *mut _ as *mut c_void; |
| 484 | let (res, context) = unsafe { |
| 485 | let r = ffi::cpg_context_get(handle.cpg_handle, &mut c_context); |
| 486 | let context: u64 = c_context as u64; |
| 487 | (r, context) |
| 488 | }; |
| 489 | if res == ffi::CS_OK { |
| 490 | Ok(context) |
| 491 | } else { |
| 492 | Err(CsError::from_c(res)) |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | /// Set the current 'context' value for this handle. |
| 497 | /// The context value is an arbitrary value that is always passed |