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<Self>),
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<Self>)
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 fn hash_value(&self) -> [u8; 16]
pub fn hash_value(&self) -> [u8; 16]
Stable hash used for index/storage fingerprints.
Source§impl Value
impl Value
Sourcepub fn from_list<T: Into<Self> + Clone>(items: &[T]) -> Self
pub fn from_list<T: Into<Self> + Clone>(items: &[T]) -> Self
CONSTRUCTION
Build a Value::List from a slice of items convertible into 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]>
Sourcepub fn to_index_fingerprint(&self) -> Option<[u8; 16]>
pub fn to_index_fingerprint(&self) -> Option<[u8; 16]>
Stable 128-bit hash used for index keys; returns None for non-indexable values.
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.
Sourcepub fn text_eq(&self, other: &Self, mode: TextMode) -> Option<bool>
pub fn text_eq(&self, other: &Self, mode: TextMode) -> Option<bool>
Case-sensitive/insensitive equality check for text-like values.
Sourcepub fn text_contains(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn text_contains(&self, needle: &Self, mode: TextMode) -> Option<bool>
Check whether other is a substring of self under the given text mode.
Sourcepub fn text_starts_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn text_starts_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
Check whether self starts with other under the given text mode.
Sourcepub fn text_ends_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
pub fn text_ends_with(&self, needle: &Self, mode: TextMode) -> Option<bool>
Check whether self ends with other under the given text mode.
Sourcepub fn is_not_empty(&self) -> Option<bool>
pub fn is_not_empty(&self) -> Option<bool>
Logical negation of is_empty.
Sourcepub fn contains(&self, needle: &Self) -> Option<bool>
pub fn contains(&self, needle: &Self) -> Option<bool>
COLLECTIONS
Returns true if self contains needle (or equals it for scalars).
Sourcepub fn contains_any(&self, needles: &Self) -> Option<bool>
pub fn contains_any(&self, needles: &Self) -> Option<bool>
Returns true if any item in needles matches a member of self.
Sourcepub fn contains_all(&self, needles: &Self) -> Option<bool>
pub fn contains_all(&self, needles: &Self) -> Option<bool>
Returns true if every item in needles matches a member of self.
Sourcepub fn in_list(&self, haystack: &Self) -> Option<bool>
pub fn in_list(&self, haystack: &Self) -> Option<bool>
Returns true if self exists inside the provided list.
Sourcepub fn contains_ci(&self, needle: &Self) -> Option<bool>
pub fn contains_ci(&self, needle: &Self) -> Option<bool>
Case-insensitive contains supporting text and identifier variants.
Sourcepub fn contains_any_ci(&self, needles: &Self) -> Option<bool>
pub fn contains_any_ci(&self, needles: &Self) -> Option<bool>
Case-insensitive variant of contains_any.
Sourcepub fn contains_all_ci(&self, needles: &Self) -> Option<bool>
pub fn contains_all_ci(&self, needles: &Self) -> Option<bool>
Case-insensitive variant of contains_all.
Sourcepub fn in_list_ci(&self, haystack: &Self) -> Option<bool>
pub fn in_list_ci(&self, haystack: &Self) -> Option<bool>
Case-insensitive variant of in_list.
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>,
Source§impl From<Subaccount> for Value
impl From<Subaccount> for Value
Source§fn from(v: Subaccount) -> Self
fn from(v: Subaccount) -> Self
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)