pub enum Value {
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(String),
Binary(Vec<u8>),
Json(Value),
Quantum(Box<QftFile>),
Complex {
re: f64,
im: f64,
},
Array(Vec<Value>),
Map(HashMap<String, Value>),
}Expand description
A database value - supports classical data and quantum states
Variants§
Null
Null value
Bool(bool)
Boolean value
Integer(i64)
Integer value
Float(f64)
Floating point value
String(String)
String value
Binary(Vec<u8>)
Binary data
Json(Value)
JSON document
Quantum(Box<QftFile>)
Quantum state (serialized QFT)
Complex
Complex number
Array(Vec<Value>)
Array of values
Map(HashMap<String, Value>)
Map of key-value pairs
Implementations§
Source§impl Value
impl Value
Sourcepub fn is_quantum(&self) -> bool
pub fn is_quantum(&self) -> bool
Check if value is a quantum state
Sourcepub fn as_quantum(&self) -> Option<&QftFile>
pub fn as_quantum(&self) -> Option<&QftFile>
Get as quantum state if applicable
Sourcepub fn as_quantum_mut(&mut self) -> Option<&mut QftFile>
pub fn as_quantum_mut(&mut self) -> Option<&mut QftFile>
Get as mutable quantum state if applicable
Sourcepub fn to_complex(&self) -> Option<Complex64>
pub fn to_complex(&self) -> Option<Complex64>
Convert to Complex64 if applicable
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
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