pub enum ValueRef<'a> {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(&'a str),
Binary(&'a [u8]),
Vector(VectorRef<'a>),
Uuid(Uuid),
List(&'a [Value]),
Map(&'a BTreeMap<String, Value>),
}Expand description
An allocation-free borrowed view of a Value.
Scalar values are copied, while variable-width payloads retain references
to their owner. Use ValueRef::to_owned_value only at an ownership
boundary such as final result materialization.
Variants§
Null
Bool(bool)
Int(i64)
Float(f64)
String(&'a str)
Binary(&'a [u8])
Vector(VectorRef<'a>)
Uuid(Uuid)
List(&'a [Value])
Map(&'a BTreeMap<String, Value>)
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
pub const fn is_null(self) -> bool
pub const fn logical_type(self) -> Option<LogicalType>
pub const fn as_bool(self) -> Option<bool>
pub const fn as_i64(self) -> Option<i64>
pub const fn as_f64(self) -> Option<f64>
pub const fn as_str(self) -> Option<&'a str>
pub const fn as_binary(self) -> Option<&'a [u8]>
pub const fn as_uuid(self) -> Option<Uuid>
pub const fn as_list(self) -> Option<&'a [Value]>
pub const fn as_map(self) -> Option<&'a BTreeMap<String, Value>>
pub fn to_owned_value(self) -> Value
Trait Implementations§
impl<'a> Copy for ValueRef<'a>
impl Eq for ValueRef<'_>
Source§impl Ord for ValueRef<'_>
impl Ord for ValueRef<'_>
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<'a> Freeze for ValueRef<'a>
impl<'a> RefUnwindSafe for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnsafeUnpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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