#[non_exhaustive]pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
Timestamp(i64),
String(String),
Link(usize),
}Expand description
A single parsed cell value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Null
The cell is absent or could not be decoded.
Bool(bool)
Boolean cell.
Int(i64)
Integer cell (i64).
Float(f64)
Float or double cell (stored as f64).
Timestamp(i64)
Unix timestamp in seconds.
String(String)
UTF-8 string or binary data column.
Link(usize)
Row index in a linked table.
Implementations§
Source§impl Value
impl Value
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if the value is Value::Null.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the inner &str if this is a Value::String, otherwise "".
Sourcepub fn as_int(&self) -> i64
pub fn as_int(&self) -> i64
Returns the inner i64 if this is a Value::Int, otherwise 0.
Sourcepub fn as_bool(&self) -> bool
pub fn as_bool(&self) -> bool
Returns the inner bool if this is a Value::Bool, otherwise false.
Sourcepub fn as_timestamp(&self) -> i64
pub fn as_timestamp(&self) -> i64
Returns the inner Unix timestamp if this is a Value::Timestamp, otherwise 0.
Sourcepub fn as_float(&self) -> f64
pub fn as_float(&self) -> f64
Returns the inner f64 if this is a Value::Float, otherwise 0.0.
Trait Implementations§
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 UnsafeUnpin 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