pub enum Value {
Int(i64),
Float(f64),
Bool(bool),
Str(String),
DateTime(i64),
Uuid([u8; 16]),
Bytes(Vec<u8>),
Json(Box<[u8]>),
Empty,
}Expand description
A single scalar value. Optional fields use Empty (set-based nullability).
Variants§
Int(i64)
Float(f64)
Bool(bool)
Str(String)
DateTime(i64)
Uuid([u8; 16])
Bytes(Vec<u8>)
Json(Box<[u8]>)
Canonical PJ1 (binary JSON) bytes. Rendered as canonical JSON text on
the wire; ordered by the PJ1 total order. See crate::pj1.
Empty
Implementations§
Source§impl Value
impl Value
pub fn type_id(&self) -> TypeId
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
Number of bytes this value occupies when encoded in a row.
pub fn is_empty(&self) -> bool
Sourcepub fn to_wire_string(&self) -> String
pub fn to_wire_string(&self) -> String
Canonical wire/text rendering of a value, shared by the server protocol,
the CLI, and the embedded bindings so a result is identical however it is
read. Empty (NULL) renders as the bareword null — the sentinel the
typed-row decoders recognize; a UUID renders as the canonical hyphenated
form; bytes render as a <N bytes> placeholder (the binary wire path
does not stringify raw bytes).
Trait Implementations§
impl Eq for Value
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
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