pub enum Value {
Show 26 variants
Account(Account),
Blob(Vec<u8>),
Bool(bool),
Date(Date),
Decimal(Decimal),
Duration(Duration),
Enum(ValueEnum),
E8s(E8s),
E18s(E18s),
Float32(Float32),
Float64(Float64),
Int(i64),
Int128(Int128),
IntBig(Int),
List(Vec<Value>),
None,
Principal(Principal),
Subaccount(Subaccount),
Text(String),
Timestamp(Timestamp),
Uint(u64),
Uint128(Nat128),
UintBig(Nat),
Ulid(Ulid),
Unit,
Unsupported,
}Expand description
Value can be used in WHERE statements
None → the field’s value is Option::None (i.e., SQL NULL). Unit → internal placeholder for RHS; not a real value. Unsupported → the field exists but isn’t filterable/indexable.
Variants§
Account(Account)
Blob(Vec<u8>)
Bool(bool)
Date(Date)
Decimal(Decimal)
Duration(Duration)
Enum(ValueEnum)
E8s(E8s)
E18s(E18s)
Float32(Float32)
Float64(Float64)
Int(i64)
Int128(Int128)
IntBig(Int)
List(Vec<Value>)
None
Principal(Principal)
Subaccount(Subaccount)
Text(String)
Timestamp(Timestamp)
Uint(u64)
Uint128(Nat128)
UintBig(Nat)
Ulid(Ulid)
Unit
Unsupported
Implementations§
Source§impl Value
impl Value
Sourcepub const fn is_numeric(&self) -> bool
pub const fn is_numeric(&self) -> bool
TYPES
Returns true if the value is one of the numeric-like variants supported by numeric comparison/ordering.
Sourcepub const fn is_unit(&self) -> bool
pub const fn is_unit(&self) -> bool
Returns true if the value is Unit (used for presence/null comparators).
pub const fn is_scalar(&self) -> bool
Sourcepub const fn as_key(&self) -> Option<Key>
pub const fn as_key(&self) -> Option<Key>
CONVERSION
NOTE: Unit is intentionally treated as a valid key and indexable,
used for tables with exactly one row or synthetic “single identity”
entities. Only None and Unsupported are non-indexable.
pub const fn as_text(&self) -> Option<&str>
pub const fn as_list(&self) -> Option<&[Self]>
pub fn to_index_fingerprint(&self) -> Option<[u8; 16]>
Sourcepub fn cmp_numeric(&self, other: &Self) -> Option<Ordering>
pub fn cmp_numeric(&self, other: &Self) -> Option<Ordering>
Cross-type numeric comparison; returns None if non-numeric.
pub fn text_eq(&self, other: &Self, mode: TextMode) -> Option<bool>
pub fn text_contains(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn text_starts_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn text_ends_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn is_not_empty(&self) -> Option<bool>
pub fn contains_any(&self, needles: &Self) -> Option<bool>
pub fn contains_all(&self, needles: &Self) -> Option<bool>
pub fn in_list(&self, haystack: &Self) -> Option<bool>
pub fn contains_ci(&self, needle: &Self) -> Option<bool>
pub fn contains_any_ci(&self, needles: &Self) -> Option<bool>
pub fn contains_all_ci(&self, needles: &Self) -> Option<bool>
pub fn in_list_ci(&self, haystack: &Self) -> Option<bool>
Trait Implementations§
Source§impl CandidType for Value
impl CandidType for Value
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
Source§impl From<Subaccount> for Value
impl From<Subaccount> for Value
Source§fn from(v: Subaccount) -> Self
fn from(v: Subaccount) -> Self
Converts to this type from the input type.
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl ValueFamilyExt for Value
impl ValueFamilyExt for Value
fn family(&self) -> ValueFamily
impl Eq for Value
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