pub enum PklValue<'a> {
Bool(bool),
Float(f64),
Int(i64),
String(&'a str),
MultiLineString(&'a str),
Object(HashMap<&'a str, PklValue<'a>>),
ClassInstance(&'a str, HashMap<&'a str, PklValue<'a>>),
}
Expand description
Represents a value in the PKL format.
The PklValue
enum encapsulates various types of values that can be parsed from a PKL string.
These include booleans, floats, integers, strings, multiline strings, objects, and class instances.
§Variants
Bool
- Represents a boolean value.Float
- Represents a floating-point number.Int
- Represents an integer, which can be decimal, octal, hex, or binary.String
- Represents a single-line string.MultiLineString
- Represents a multiline string.Object
- Represents a nested object, which is a hashmap of key-value pairs.ClassInstance
- Represents an instance of a class, which includes the class name and its properties.
Variants§
Bool(bool)
A boolean value.
Float(f64)
A floating-point number.
Int(i64)
An integer value.
String(&'a str)
A single-line string.
MultiLineString(&'a str)
A multiline string.
Object(HashMap<&'a str, PklValue<'a>>)
A nested object represented as a hashmap of key-value pairs.
ClassInstance(&'a str, HashMap<&'a str, PklValue<'a>>)
An instance of a class, including the class name and its properties.
Trait Implementations§
impl<'a> StructuralPartialEq for PklValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for PklValue<'a>
impl<'a> RefUnwindSafe for PklValue<'a>
impl<'a> Send for PklValue<'a>
impl<'a> Sync for PklValue<'a>
impl<'a> Unpin for PklValue<'a>
impl<'a> UnwindSafe for PklValue<'a>
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