MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / deserialize_rows

Method deserialize_rows

sdk-rust/src/result.rs:102–111  ·  view source on GitHub ↗

Deserialize all rows into a vector of the given type Each row is converted to a JSON object and then deserialized into the target type using serde. # Type Parameters `T` - Type to deserialize each row into (must implement Deserialize) # Examples ```no_run use serde::Deserialize; # use graphlite_sdk::GraphLite; #[derive(Deserialize)] struct Person { name: String, age: u32 } # fn main() -> Re

(&self)

Source from the content-addressed store, hash-verified

100 /// # }
101 /// ```
102 pub fn deserialize_rows<T: DeserializeOwned>(&self) -> Result<Vec<T>> {
103 let mut results = Vec::new();
104
105 for row in &self.inner.rows {
106 let item = self.deserialize_row::<T>(row)?;
107 results.push(item);
108 }
109
110 Ok(results)
111 }
112
113 /// Deserialize a single row into the given type
114 ///

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected