Set 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. Normally this is set in [initialize], but this allows it to be changed
(handle: &Handle, context: u64)
| 498 | /// back to callbacks to help identify the source. |
| 499 | /// Normally this is set in [initialize], but this allows it to be changed |
| 500 | pub fn context_set(handle: &Handle, context: u64) -> Result<()> { |
| 501 | let res = unsafe { |
| 502 | let c_context = context as *mut c_void; |
| 503 | ffi::cpg_context_set(handle.cpg_handle, c_context) |
| 504 | }; |
| 505 | if res == ffi::CS_OK { |
| 506 | Ok(()) |
| 507 | } else { |
| 508 | Err(CsError::from_c(res)) |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /// Get the flow control state of corosync CPG |
| 513 | pub fn flow_control_state_get(handle: &Handle) -> Result<bool> { |