aboutsummaryrefslogtreecommitdiffstats
path: root/autere_db/src/record.rs
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-05-03 00:15:02 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-05-03 00:20:36 +0300
commit84ac3652415b662aae9580c008a5aa996d58c9f4 (patch)
tree3d39fe6ce5da76a1102458c120480e4190a70fcf /autere_db/src/record.rs
parente17048eddfe2df86abd2d498da2a33b9c3dd8a72 (diff)
Rename to AutereDB
Diffstat (limited to 'autere_db/src/record.rs')
-rw-r--r--autere_db/src/record.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/autere_db/src/record.rs b/autere_db/src/record.rs
new file mode 100644
index 0000000..b349853
--- /dev/null
+++ b/autere_db/src/record.rs
@@ -0,0 +1,38 @@
+use super::*;
+
+pub struct Record {
+ values: Vec<Value>,
+}
+
+impl Record {
+ pub fn values(&self) -> &[Value] {
+ &self.values
+ }
+}
+
+impl IntoIterator for Record {
+ type Item = Value;
+ type IntoIter = std::vec::IntoIter<Self::Item>;
+
+ fn into_iter(self) -> Self::IntoIter {
+ self.values.into_iter()
+ }
+}
+
+impl From<Vec<Value>> for Record {
+ fn from(values: Vec<Value>) -> Self {
+ Record { values }
+ }
+}
+
+impl From<Record> for Vec<Value> {
+ fn from(record: Record) -> Self {
+ record.values
+ }
+}
+
+impl From<Row> for Record {
+ fn from(row: Row) -> Self {
+ Record { values: row.values }
+ }
+}