Put a key-value pair into a column family
(&self, cf_name: &str, key: &[u8], value: &[u8])
| 45 | |
| 46 | // Put a key-value pair into a column family |
| 47 | pub fn put_cf(&self, cf_name: &str, key: &[u8], value: &[u8]) -> Result<(), WaCustomError> { |
| 48 | match self.db.cf_handle(cf_name) { |
| 49 | Some(cf_handle) => { |
| 50 | let result = self.db.put_cf(cf_handle, key, value); |
| 51 | match result { |
| 52 | Ok(_) => return Ok(()), |
| 53 | Err(e) => Err(WaCustomError::CFReadWriteFailed(e.into_string())), |
| 54 | } |
| 55 | } |
| 56 | None => Err(WaCustomError::CFNotFound), |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // Get a value from a column family by key |
| 61 | pub fn get_cf(&self, cf_name: &str, key: &[u8]) -> Result<Option<Vec<u8>>, WaCustomError> { |
nothing calls this directly
no outgoing calls
no test coverage detected