pub enum Value {
Null,
Integer(i64),
Real(f64),
Text(String),
Blob(Vec<u8>),
Boolean(bool),
}
Expand description
Represents a database value that can be serialized/deserialized
The Value
enum covers all possible SQLite/libsql data types and provides
automatic conversion from common Rust types. It supports JSON serialization
for easy data exchange.
§Examples
use libsql_orm::Value;
let null_val = Value::Null;
let int_val = Value::Integer(42);
let text_val = Value::Text("hello".to_string());
let bool_val = Value::Boolean(true);
// Automatic conversion
let converted: Value = "hello".into();
let converted: Value = 42i64.into();
let converted: Value = true.into();
Variants§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more