From 29d463aa89c9cf633bf026741ab36818fad5d616 Mon Sep 17 00:00:00 2001 From: Peter Hayman Date: Mon, 28 Apr 2025 00:22:39 +1000 Subject: [PATCH 1/2] implement Clone for Arc types --- bindings/rust/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bindings/rust/src/lib.rs b/bindings/rust/src/lib.rs index 8c57e7909..783012c5d 100644 --- a/bindings/rust/src/lib.rs +++ b/bindings/rust/src/lib.rs @@ -129,6 +129,14 @@ pub struct Statement { inner: Arc>, } +impl Clone for Statement { + fn clone(&self) -> Self { + Self { + inner: Arc::clone(&self.inner), + } + } +} + unsafe impl Send for Statement {} unsafe impl Sync for Statement {} @@ -241,6 +249,14 @@ pub struct Rows { inner: Arc>, } +impl Clone for Rows { + fn clone(&self) -> Self { + Self { + inner: Arc::clone(&self.inner), + } + } +} + unsafe impl Send for Rows {} unsafe impl Sync for Rows {} From 8f366e98d59bcdbeb542769ed2164cf58665868b Mon Sep 17 00:00:00 2001 From: Peter Hayman Date: Thu, 1 May 2025 15:31:38 +1000 Subject: [PATCH 2/2] add Row::column_count --- bindings/rust/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/rust/src/lib.rs b/bindings/rust/src/lib.rs index 783012c5d..6c04c231a 100644 --- a/bindings/rust/src/lib.rs +++ b/bindings/rust/src/lib.rs @@ -297,4 +297,8 @@ impl Row { limbo_core::OwnedValue::Blob(items) => Ok(Value::Blob(items.to_vec())), } } + + pub fn column_count(&self) -> usize { + self.values.len() + } }