MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / extract_all

Method extract_all

nodedb-strict/src/decode.rs:237–243  ·  view source on GitHub ↗

Extract all columns from a tuple into a Vec .

(&self, tuple: &[u8])

Source from the content-addressed store, hash-verified

235
236 /// Extract all columns from a tuple into a Vec<Value>.
237 pub fn extract_all(&self, tuple: &[u8]) -> Result<Vec<Value>, StrictError> {
238 let mut values = Vec::with_capacity(self.schema.columns.len());
239 for i in 0..self.schema.columns.len() {
240 values.push(self.extract_value(tuple, i)?);
241 }
242 Ok(values)
243 }
244
245 /// Extract a column by name.
246 pub fn extract_by_name(&self, tuple: &[u8], name: &str) -> Result<Value, StrictError> {

Callers 5

binary_tuple_to_valueFunction · 0.80
roundtrip_all_fieldsFunction · 0.80
roundtrip_with_nullsFunction · 0.80
all_types_roundtripFunction · 0.80

Calls 3

extract_valueMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45

Tested by 4

roundtrip_all_fieldsFunction · 0.64
roundtrip_with_nullsFunction · 0.64
all_types_roundtripFunction · 0.64