MCPcopy Create free account
hub / github.com/cosdata/cosdata / get_cf

Method get_cf

org/src/persist.rs:61–72  ·  view source on GitHub ↗

Get a value from a column family by key

(&self, cf_name: &str, key: &[u8])

Source from the content-addressed store, hash-verified

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> {
62 match self.db.cf_handle(cf_name) {
63 Some(cf_handle) => {
64 let result = self.db.get_cf(cf_handle, key);
65 match result {
66 Ok(res) => return Ok(res),
67 Err(e) => Err(WaCustomError::CFReadWriteFailed(e.into_string())),
68 }
69 }
70 None => Err(WaCustomError::CFNotFound),
71 }
72 }
73}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected