pub enum Scalar {
Number(String),
String(String),
Boolean(bool),
Date(String),
Instant(String),
Blob(String),
}Expand description
A typed scalar value in its one canonical lexical form.
Variants§
Number(String)
A canonical decimal string.
String(String)
A valid string value.
Boolean(bool)
A boolean.
Date(String)
A calendar date.
Instant(String)
A UTC instant with microseconds.
Blob(String)
A blob reference.
Implementations§
Source§impl Scalar
impl Scalar
Sourcepub fn from_lexical(ty: Type, text: &str) -> Result<Scalar>
pub fn from_lexical(ty: Type, text: &str) -> Result<Scalar>
Builds a scalar of type ty from its lexical form, checking it (3). For a boolean,
text must be true or false (E_CANON_TYPE otherwise).
Trait Implementations§
impl Eq for Scalar
Source§impl Ord for Scalar
impl Ord for Scalar
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
Source§impl PartialOrd for Scalar
impl PartialOrd for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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