pub enum Value {
Show 32 variants
None {
inner: Type,
},
Boolean(bool),
Float4(OrderedF32),
Float8(OrderedF64),
Int1(i8),
Int2(i16),
Int4(i32),
Int8(i64),
Int16(i128),
Utf8(String),
Uint1(u8),
Uint2(u16),
Uint4(u32),
Uint8(u64),
Uint16(u128),
Date(Date),
DateTime(DateTime),
Time(Time),
Duration(Duration),
IdentityId(IdentityId),
Uuid4(Uuid4),
Uuid7(Uuid7),
Blob(Blob),
Int(Int),
Uint(Uint),
Decimal(Decimal),
Any(Box<Value>),
DictionaryId(DictionaryEntryId),
Type(Type),
List(Vec<Value>),
Record(Vec<(String, Value)>),
Tuple(Vec<Value>),
}Expand description
A RQL value, represented as a native Rust type.
Variants§
None
Value is none (think null in common programming languages)
Boolean(bool)
A boolean: true or false.
Float4(OrderedF32)
A 4-byte floating point
Float8(OrderedF64)
An 8-byte floating point
Int1(i8)
A 1-byte signed integer
Int2(i16)
A 2-byte signed integer
Int4(i32)
A 4-byte signed integer
Int8(i64)
An 8-byte signed integer
Int16(i128)
A 16-byte signed integer
Utf8(String)
A UTF-8 encoded text. Maximum 255 bytes
Uint1(u8)
A 1-byte unsigned integer
Uint2(u16)
A 2-byte unsigned integer
Uint4(u32)
A 4-byte unsigned integer
Uint8(u64)
A 8-byte unsigned integer
Uint16(u128)
A 16-byte unsigned integer
Date(Date)
A date value (year, month, day)
DateTime(DateTime)
A date and time value with nanosecond precision in SVTC
Time(Time)
A time value (hour, minute, second, nanosecond)
Duration(Duration)
A duration representing a duration
IdentityId(IdentityId)
An identity identifier (UUID v7)
Uuid4(Uuid4)
A UUID version 4 (random)
Uuid7(Uuid7)
A UUID version 7 (timestamp-based)
Blob(Blob)
A binary large object (BLOB)
Int(Int)
An arbitrary-precision signed integer
Uint(Uint)
An arbitrary-precision unsigned integer
Decimal(Decimal)
An arbitrary-precision decimal
Any(Box<Value>)
A container that can hold any value type
DictionaryId(DictionaryEntryId)
A dictionary entry identifier
Type(Type)
A type value (first-class type identifier)
List(Vec<Value>)
An ordered list of values
Record(Vec<(String, Value)>)
A record (named fields with values)
Tuple(Vec<Value>)
A tuple of heterogeneous values
Implementations§
Source§impl Value
impl Value
pub fn none() -> Value
pub fn none_of(ty: Type) -> Value
pub fn bool(v: impl Into<bool>) -> Value
pub fn float4(v: impl Into<f32>) -> Value
pub fn float8(v: impl Into<f64>) -> Value
pub fn int1(v: impl Into<i8>) -> Value
pub fn int2(v: impl Into<i16>) -> Value
pub fn int4(v: impl Into<i32>) -> Value
pub fn int8(v: impl Into<i64>) -> Value
pub fn int16(v: impl Into<i128>) -> Value
pub fn utf8(v: impl Into<String>) -> Value
pub fn uint1(v: impl Into<u8>) -> Value
pub fn uint2(v: impl Into<u16>) -> Value
pub fn uint4(v: impl Into<u32>) -> Value
pub fn uint8(v: impl Into<u64>) -> Value
pub fn uint16(v: impl Into<u128>) -> Value
pub fn date(v: impl Into<Date>) -> Value
pub fn datetime(v: impl Into<DateTime>) -> Value
pub fn time(v: impl Into<Time>) -> Value
pub fn duration(v: impl Into<Duration>) -> Value
pub fn identity_id(v: impl Into<IdentityId>) -> Value
pub fn uuid4(v: impl Into<Uuid4>) -> Value
pub fn uuid7(v: impl Into<Uuid7>) -> Value
pub fn blob(v: impl Into<Blob>) -> Value
pub fn any(v: impl Into<Value>) -> Value
pub fn list(items: Vec<Value>) -> Value
pub fn record(fields: Vec<(String, Value)>) -> Value
pub fn to_usize(&self) -> Option<usize>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoEncodedKey for &Value
impl IntoEncodedKey for &Value
fn into_encoded_key(self) -> EncodedKey
Source§impl IntoEncodedKey for Value
impl IntoEncodedKey for Value
fn into_encoded_key(self) -> EncodedKey
Source§impl Ord for Value
impl Ord for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl Serialize for Value
impl Serialize for Value
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TryFromValue for Value
impl TryFromValue for Value
Source§fn try_from_value(value: &Value) -> Result<Value, FromValueError>
fn try_from_value(value: &Value) -> Result<Value, FromValueError>
impl Eq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request