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)
| 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 | /// |