From 84ac3652415b662aae9580c008a5aa996d58c9f4 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 3 May 2025 00:15:02 +0300 Subject: Rename to AutereDB --- autere_db/src/record.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 autere_db/src/record.rs (limited to 'autere_db/src/record.rs') 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, +} + +impl Record { + pub fn values(&self) -> &[Value] { + &self.values + } +} + +impl IntoIterator for Record { + type Item = Value; + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.values.into_iter() + } +} + +impl From> for Record { + fn from(values: Vec) -> Self { + Record { values } + } +} + +impl From for Vec { + fn from(record: Record) -> Self { + record.values + } +} + +impl From for Record { + fn from(row: Row) -> Self { + Record { values: row.values } + } +} -- cgit v1.3