pub enum Value {
Show 22 variants
Nil,
Bool(bool),
Tinyint(i8),
Smallint(i16),
Int(i32),
Bigint(i64),
Float(f32),
Double(f64),
BigDecimal(BigDecimal),
Blob(Vec<u8, Global>),
Char(char),
Text(String),
Json(String),
Uuid(Uuid),
Date(NaiveDate),
Time(NaiveTime),
DateTime(NaiveDateTime),
Timestamp(DateTime<Utc>),
Interval(Interval),
SerdeJson(Value),
Object(IndexMap<String, Value, RandomState>),
Array(Array),
}
Variants
Nil
Bool(bool)
Tinyint(i8)
Smallint(i16)
Int(i32)
Bigint(i64)
Float(f32)
Double(f64)
BigDecimal(BigDecimal)
Blob(Vec<u8, Global>)
Char(char)
Text(String)
Json(String)
Uuid(Uuid)
Date(NaiveDate)
Time(NaiveTime)
DateTime(NaiveDateTime)
Timestamp(DateTime<Utc>)
Interval(Interval)
SerdeJson(Value)
Object(IndexMap<String, Value, RandomState>)
Array(Array)
Implementations
sourceimpl Value
impl Value
pub fn is_nil(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_object(&self) -> bool
pub fn as_object(&self) -> Option<&IndexMap<String, Value, RandomState>>
pub fn as_object_mut(
&mut self
) -> Option<&mut IndexMap<String, Value, RandomState>>
pub fn is_array(&self) -> bool
pub fn as_array(&self) -> Option<&Array>
pub fn as_str(&self) -> Option<&str>
pub fn is_number(&self) -> bool
pub fn is_boolean(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn is_null(&self) -> bool
pub fn as_null(&self) -> Option<()>
pub fn take(&mut self) -> Value
pub fn new_object() -> Value
pub fn insert_obj<K, V>(&mut self, k: K, v: V) where
K: ToString,
V: ToValue,
pub fn insert_obj_value<K>(&mut self, k: K, value: &Value) where
K: ToString,
pub fn get_obj<T>(&'a self, s: &str) -> Result<T, AkitaDataError> where
T: FromValue,
pub fn get_obj_len(&'a self) -> usize
pub fn get_obj_opt<T>(&'a self, s: &str) -> Result<Option<T>, AkitaDataError> where
T: FromValue,
pub fn get_obj_value(&self, s: &str) -> Option<&Value>
pub fn remove_obj(&mut self, s: &str) -> Option<Value>
sourcepub fn take_obj_raw<T>(&'a self, index: usize) -> Option<T> where
T: FromValue,
pub fn take_obj_raw<T>(&'a self, index: usize) -> Option<T> where
T: FromValue,
Will take value of a column with index index
if it exists and wasn’t taken earlier then
will converts it to T
.
sourcepub fn take_obj_raw_opt<T>(
&'a self,
index: usize
) -> Option<Result<T, AkitaDataError>> where
T: FromValue,
pub fn take_obj_raw_opt<T>(
&'a self,
index: usize
) -> Option<Result<T, AkitaDataError>> where
T: FromValue,
Will take value of a column with index index
if it exists and wasn’t taken earlier then
will attempt to convert it to T
. Unlike Row::take
, Row::take_opt
will allow you to
directly handle errors if the value could not be converted to T
.
Trait Implementations
sourceimpl FromValue for Value
impl FromValue for Value
fn from_value_opt(v: &Value) -> Result<Value, AkitaDataError>
fn from_value(v: &Value) -> Self
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more