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

Function context_get

bindings/rust/src/cpg.rs:482–494  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

480/// The context value is an arbitrary value that is always passed
481/// back to callbacks to help identify the source
482pub 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

Callers 3

mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls 1

cpg_context_getFunction · 0.85

Tested by 3

mainFunction · 0.40
mainFunction · 0.40
mainFunction · 0.40