pub enum Value {
Integer(i64),
Float(f64),
String(String),
Boolean(bool),
Bytes(Vec<u8>),
Array(Vec<Value>),
Dictionary(IndexMap<String, Value>),
Null,
}Expand description
A runtime value in FiddlerScript.
Variants§
Integer(i64)
Integer value
Float(f64)
Float value (64-bit floating point)
String(String)
String value
Boolean(bool)
Boolean value
Bytes(Vec<u8>)
Bytes value (raw binary data)
Array(Vec<Value>)
Array value (list of values)
Dictionary(IndexMap<String, Value>)
Dictionary value (key-value pairs with insertion order preserved)
Null
Represents no value (e.g., from a function with no return)
Implementations§
Source§impl Value
impl Value
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Try to create a Value from bytes, interpreting as UTF-8 string.
Sourcepub fn as_string_lossy(&self) -> Result<String, RuntimeError>
pub fn as_string_lossy(&self) -> Result<String, RuntimeError>
Convert to string, handling both String and Bytes variants.
Returns an error if the value is not a String or Bytes type. For Bytes, invalid UTF-8 sequences are replaced with the Unicode replacement character.
Sourcepub fn is_dictionary(&self) -> bool
pub fn is_dictionary(&self) -> bool
Check if the value is a dictionary.
Trait Implementations§
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