pub enum Value {
Null,
Numeric(Numeric),
Text(Text),
Blob(Vec<u8>),
}Variants§
Implementations§
Source§impl Value
impl Value
pub const fn from_f64(f: f64) -> Self
pub const fn from_i64(i: i64) -> Self
pub fn as_ref<'a>(&'a self) -> ValueRef<'a>
pub fn build_text(text: impl Into<Cow<'static, str>>) -> Self
pub fn to_blob(&self) -> Option<&[u8]>
pub fn from_blob(data: Vec<u8>) -> Self
pub fn to_text(&self) -> Option<&str>
pub const fn as_blob(&self) -> &Vec<u8> ⓘ
pub const fn as_blob_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn as_float(&self) -> f64
pub fn to_float_or_zero(&self) -> f64
pub const fn as_int(&self) -> Option<i64>
pub const fn as_uint(&self) -> u64
pub fn from_text(text: impl Into<Cow<'static, str>>) -> Self
pub const fn value_type(&self) -> ValueType
pub fn serialize_serial(&self, out: &mut Vec<u8>)
Source§impl Value
impl Value
Sourcepub const MAX_BLOB_LENGTH: i64 = 1_000_000_000
pub const MAX_BLOB_LENGTH: i64 = 1_000_000_000
SQLite default max blob/string size (1GB)
pub fn exec_lower(&self) -> Option<Self>
pub fn exec_length(&self) -> Self
pub fn exec_octet_length(&self) -> Self
pub fn exec_upper(&self) -> Option<Self>
pub fn exec_sign(&self) -> Option<Value>
Sourcepub fn exec_soundex(&self) -> Value
pub fn exec_soundex(&self) -> Value
Generates the Soundex code for a given word
pub fn exec_abs(&self) -> Result<Self>
pub fn exec_random<F>(generate_random_number: F) -> Self
pub fn exec_randomblob<F>(&self, fill_bytes: F) -> Result<Value>
pub fn exec_quote(&self) -> Self
pub fn exec_unistr_quote(&self) -> Self
pub fn exec_nullif(&self, second_value: &Self) -> Self
pub fn exec_substring( value: &Value, start_value: &Value, length_value: Option<&Value>, ) -> Value
pub fn exec_instr(&self, pattern: &Value) -> Value
pub fn exec_typeof(&self) -> Value
pub fn exec_hex(&self) -> Value
pub fn exec_unhex(&self, ignored_chars: Option<&Value>) -> Value
pub fn exec_unicode(&self) -> Value
pub fn exec_unistr(&self) -> Result<Value>
pub fn exec_round(&self, precision: Option<&Value>) -> Value
pub fn exec_trim(&self, pattern: Option<&Value>) -> Value
pub fn exec_rtrim(&self, pattern: Option<&Value>) -> Value
pub fn exec_ltrim(&self, pattern: Option<&Value>) -> Value
pub fn exec_zeroblob(&self) -> Result<Value>
pub fn exec_if(&self, jump_if_null: bool, not: bool) -> bool
pub fn exec_cast(&self, datatype: &str) -> Value
pub fn exec_replace( source: &Value, pattern: &Value, replacement: &Value, ) -> Value
pub fn exec_math_unary(&self, function: &MathFunc) -> Value
pub fn exec_math_binary(&self, rhs: &Value, function: &MathFunc) -> Value
pub fn exec_math_log(&self, base: Option<&Value>) -> Value
pub fn exec_add(&self, rhs: &Value) -> Value
pub fn exec_subtract(&self, rhs: &Value) -> Value
pub fn exec_multiply(&self, rhs: &Value) -> Value
pub fn exec_divide(&self, rhs: &Value) -> Value
pub fn exec_bit_and(&self, rhs: &Value) -> Value
pub fn exec_bit_or(&self, rhs: &Value) -> Value
pub fn exec_remainder(&self, rhs: &Value) -> Value
pub fn exec_bit_not(&self) -> Value
pub fn exec_shift_left(&self, rhs: &Value) -> Value
pub fn exec_shift_right(&self, rhs: &Value) -> Value
pub fn exec_boolean_not(&self) -> Value
pub fn exec_concat(&self, rhs: &Value) -> Value
pub fn exec_and(&self, rhs: &Value) -> Value
pub fn exec_or(&self, rhs: &Value) -> Value
pub fn exec_like( pattern: &str, text: &str, escape: Option<char>, ) -> Result<bool, LimboError>
pub fn exec_glob(pattern: &str, text: &str) -> Result<bool, LimboError>
pub fn exec_min<'a, T: Iterator<Item = &'a Value>>(regs: T) -> Value
pub fn exec_max<'a, T: Iterator<Item = &'a Value>>(regs: T) -> Value
Sourcepub fn exec_group_concat(&mut self, other: &Value)
pub fn exec_group_concat(&mut self, other: &Value)
Concatenate another value onto this Text value, converting both to strings. Used by GROUP_CONCAT/STRING_AGG to properly handle all value types. Panics if self is not a Text value.
pub fn exec_concat_strings<'a, T: Iterator<Item = &'a Self>>( registers: T, ) -> Self
pub fn exec_concat_ws<'a, T: ExactSizeIterator<Item = &'a Self>>( registers: T, ) -> Self
pub fn exec_char<'a, T: Iterator<Item = &'a Self>>(values: T) -> Self
Trait Implementations§
Source§impl AddAssign for Value
impl AddAssign for Value
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl AddAssign<f64> for Value
impl AddAssign<f64> for Value
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
Performs the
+= operation. Read moreSource§impl AddAssign<i64> for Value
impl AddAssign<i64> for Value
Source§fn add_assign(&mut self, rhs: i64)
fn add_assign(&mut self, rhs: i64)
Performs the
+= operation. Read moreSource§impl AsValueRef for Value
impl AsValueRef for Value
fn as_value_ref<'a>(&'a self) -> ValueRef<'a>
Source§impl AsValueRef for &mut Value
impl AsValueRef for &mut Value
fn as_value_ref<'a>(&'a self) -> ValueRef<'a>
Source§impl Display for Value
Please use Display trait for all limbo output so we have single origin of truth
When you need value as string:
—GOOD—
format!(“{}”, value);
—BAD—
match value {
Value::Numeric(Numeric::Integer(i)) => i.to_string(),
Value::Numeric(Numeric::Float(f)) => f64::from(*f).to_string(),
….
}
impl Display for Value
Please use Display trait for all limbo output so we have single origin of truth When you need value as string: —GOOD— format!(“{}”, value); —BAD— match value { Value::Numeric(Numeric::Integer(i)) => i.to_string(), Value::Numeric(Numeric::Float(f)) => f64::from(*f).to_string(), …. }
Source§impl DivAssign for Value
impl DivAssign for Value
Source§fn div_assign(&mut self, rhs: Value)
fn div_assign(&mut self, rhs: Value)
Performs the
/= operation. Read moreimpl Eq for Value
Source§impl<'a> FromValueRow<'a> for &'a Value
impl<'a> FromValueRow<'a> for &'a Value
fn from_value(value: &'a Value) -> Result<Self>
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. 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 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more