From 76cc8c05a534ddc952014852f1906593cd1e2abe Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Mon, 28 Jul 2025 17:41:26 +0400 Subject: [PATCH] add conversion method --- bindings/rust/src/value.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bindings/rust/src/value.rs b/bindings/rust/src/value.rs index 567476513..824d8d19e 100644 --- a/bindings/rust/src/value.rs +++ b/bindings/rust/src/value.rs @@ -110,6 +110,18 @@ impl Value { } } +impl From for Value { + fn from(val: turso_core::Value) -> Self { + match val { + turso_core::Value::Null => Value::Null, + turso_core::Value::Integer(n) => Value::Integer(n), + turso_core::Value::Float(n) => Value::Real(n), + turso_core::Value::Text(t) => Value::Text(t.into()), + turso_core::Value::Blob(items) => Value::Blob(items), + } + } +} + impl From for turso_core::Value { fn from(val: Value) -> Self { match val {