pub enum Value {
Null,
Int(i64),
Float(f64),
Bool(bool),
String(Arc<String>),
Bytes(Arc<Vec<u8>>),
Array(Arc<Vec<Value>>),
Map(Arc<VmMap>),
}Variants§
Null
Int(i64)
Float(f64)
Bool(bool)
String(Arc<String>)
Bytes(Arc<Vec<u8>>)
Array(Arc<Vec<Value>>)
Map(Arc<VmMap>)
Implementations§
Source§impl Value
impl Value
pub fn string(value: impl Into<String>) -> Value
pub fn array(values: Vec<Value>) -> Value
pub fn bytes(value: impl Into<Vec<u8>>) -> Value
pub fn map(entries: Vec<(Value, Value)>) -> Value
pub fn into_owned_string(self) -> Result<String, Value>
pub fn into_owned_array(self) -> Result<Vec<Value>, Value>
pub fn into_owned_bytes(self) -> Result<Vec<u8>, Value>
pub fn into_owned_map(self) -> Result<VmMap, Value>
Trait Implementations§
Source§impl FormatArgument for Value
impl FormatArgument for Value
Source§fn supports_format(&self, specifier: &Specifier) -> bool
fn supports_format(&self, specifier: &Specifier) -> bool
Returns
true if self can be formatted using the given specifier.Source§fn fmt_display(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_display(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::Display.Source§fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::Debug.Source§fn fmt_octal(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_octal(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::Octal.Source§fn fmt_lower_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_lower_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::LowerHex.Source§fn fmt_upper_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_upper_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::UpperHex.Source§fn fmt_binary(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_binary(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::Binary.Source§fn fmt_lower_exp(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_lower_exp(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::LowerExp.Source§fn fmt_upper_exp(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_upper_exp(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value the way it would be formatted if it implemented
std::fmt::UpperExp.Source§fn to_usize(&self) -> Result<usize, ()>
fn to_usize(&self) -> Result<usize, ()>
Performs a type conversion into
usize that might fail. Like TryInto<usize>, but does not
consume self. The parser uses this to support formats whose width or precision use “dollar
syntax”. For more information about these, see std::fmt. The default implementation always
returns an error.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