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

Method deserialize_row

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

Deserialize a single row into the given type # Type Parameters `T` - Type to deserialize the 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() -> Result<(), graphlite_sdk::Error> { # let db = GraphLite::open("./mydb")?; # let session = db.session("admin

(&self, row: &Row)

Source from the content-addressed store, hash-verified

137 /// # }
138 /// ```
139 pub fn deserialize_row<T: DeserializeOwned>(&self, row: &Row) -> Result<T> {
140 // Convert row.values HashMap to JSON
141 let json_value = serde_json::to_value(&row.values)?;
142 let result = serde_json::from_value(json_value)?;
143 Ok(result)
144 }
145
146 /// Get the first row as the given type
147 ///

Callers 1

firstMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected