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

Function dec

bindings/rust/src/cmap.rs:676–684  ·  view source on GitHub ↗

decrement the value in a cmap key (must be a numeric type)

(handle: &Handle, key_name: &str)

Source from the content-addressed store, hash-verified

674
675/// decrement the value in a cmap key (must be a numeric type)
676pub fn dec(handle: &Handle, key_name: &str) -> Result<()> {
677 let csname = string_to_cstring_validated(key_name, CMAP_KEYNAME_MAXLENGTH)?;
678 let res = unsafe { ffi::cmap_dec(handle.cmap_handle, csname.as_ptr()) };
679 if res == ffi::CS_OK {
680 Ok(())
681 } else {
682 Err(CsError::from_c(res))
683 }
684}
685
686// Callback for CMAP notify events from corosync, convert params to Rust and pass on.
687extern "C" fn rust_notify_fn(

Callers

nothing calls this directly

Calls 2

cmap_decFunction · 0.85

Tested by

no test coverage detected