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

Function inc

bindings/rust/src/cmap.rs:665–673  ·  view source on GitHub ↗

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

(handle: &Handle, key_name: &str)

Source from the content-addressed store, hash-verified

663
664/// increment the value in a cmap key (must be a numeric type)
665pub fn inc(handle: &Handle, key_name: &str) -> Result<()> {
666 let csname = string_to_cstring_validated(key_name, CMAP_KEYNAME_MAXLENGTH)?;
667 let res = unsafe { ffi::cmap_inc(handle.cmap_handle, csname.as_ptr()) };
668 if res == ffi::CS_OK {
669 Ok(())
670 } else {
671 Err(CsError::from_c(res))
672 }
673}
674
675/// decrement the value in a cmap key (must be a numeric type)
676pub fn dec(handle: &Handle, key_name: &str) -> Result<()> {

Callers

nothing calls this directly

Calls 2

cmap_incFunction · 0.85

Tested by

no test coverage detected