increment the value in a cmap key (must be a numeric type)
(handle: &Handle, key_name: &str)
| 663 | |
| 664 | /// increment the value in a cmap key (must be a numeric type) |
| 665 | pub 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) |
| 676 | pub fn dec(handle: &Handle, key_name: &str) -> Result<()> { |
nothing calls this directly
no test coverage detected