pub enum Value {
Quantity(Quantity),
Boolean(bool),
String(CompactString),
DateTime(Zoned),
FunctionReference(FunctionReference),
FormatSpecifiers(Option<CompactString>),
StructInstance(Arc<StructInfo>, Vec<Value>),
List(NumbatList<Value>),
}Variants§
Quantity(Quantity)
Boolean(bool)
String(CompactString)
DateTime(Zoned)
A DateTime with an associated offset used when pretty printing
FunctionReference(FunctionReference)
FormatSpecifiers(Option<CompactString>)
StructInstance(Arc<StructInfo>, Vec<Value>)
List(NumbatList<Value>)
Implementations§
Source§impl Value
impl Value
pub fn unsafe_as_quantity(self) -> Quantity
pub fn unsafe_as_bool(self) -> bool
pub fn unsafe_as_string(self) -> CompactString
pub fn unsafe_as_datetime(self) -> Zoned
pub fn unsafe_as_function_reference(self) -> FunctionReference
pub fn unsafe_as_struct_fields(self) -> Vec<Value>
pub fn unsafe_as_list(self) -> NumbatList<Value>
Source§impl Value
impl Value
pub fn pretty_print(&self) -> Markup
pub fn pretty_print_with(&self, options: &FormatOptions) -> Markup
Trait Implementations§
Source§impl From<NumbatList<Value>> for Value
impl From<NumbatList<Value>> for Value
Source§fn from(list: NumbatList<Value>) -> Self
fn from(list: NumbatList<Value>) -> Self
Converts to this type from the input type.
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more