#[non_exhaustive]pub struct ScalarValue {
pub raw: String,
pub value_type: ScalarType,
}Expand description
A scalar (leaf) value inside a HOCON document.
Stores the raw string representation alongside a type tag.
Typed access (i64, f64, bool) is done by parsing raw on demand.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.raw: StringThe raw string as it appeared in the source (or was produced by resolution).
value_type: ScalarTypeThe semantic type of this scalar.
Implementations§
Source§impl ScalarValue
impl ScalarValue
Sourcepub fn new(raw: String, value_type: ScalarType) -> Self
pub fn new(raw: String, value_type: ScalarType) -> Self
Create a new scalar value with explicit type.
Trait Implementations§
Source§impl Clone for ScalarValue
impl Clone for ScalarValue
Source§fn clone(&self) -> ScalarValue
fn clone(&self) -> ScalarValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalarValue
impl Debug for ScalarValue
Source§impl PartialEq for ScalarValue
impl PartialEq for ScalarValue
impl StructuralPartialEq for ScalarValue
Auto Trait Implementations§
impl Freeze for ScalarValue
impl RefUnwindSafe for ScalarValue
impl Send for ScalarValue
impl Sync for ScalarValue
impl Unpin for ScalarValue
impl UnsafeUnpin for ScalarValue
impl UnwindSafe for ScalarValue
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