MCPcopy Create free account
hub / github.com/corosync/corosync / context_set

Function context_set

bindings/rust/src/cpg.rs:500–510  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

498/// back to callbacks to help identify the source.
499/// Normally this is set in [initialize], but this allows it to be changed
500pub 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
513pub fn flow_control_state_get(handle: &Handle) -> Result<bool> {

Callers 3

mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls 1

cpg_context_setFunction · 0.85

Tested by 3

mainFunction · 0.40
mainFunction · 0.40
mainFunction · 0.40