Get the value for a single key
(&self, key: S)
| 43 | |
| 44 | /// Get the value for a single key |
| 45 | pub fn value<S: BnStrCompatible>(&self, key: S) -> Option<DataBuffer> { |
| 46 | let key_raw = key.into_bytes_with_nul(); |
| 47 | let key_ptr = key_raw.as_ref().as_ptr() as *const c_char; |
| 48 | let result = unsafe { BNGetKeyValueStoreBuffer(self.handle.as_ptr(), key_ptr) }; |
| 49 | NonNull::new(result).map(|_| DataBuffer::from_raw(result)) |
| 50 | } |
| 51 | |
| 52 | /// Set the value for a single key |
| 53 | pub fn set_value<S: BnStrCompatible>(&self, key: S, value: &DataBuffer) -> bool { |
no test coverage detected