#[non_exhaustive]pub struct Scalar { /* private fields */ }Available on crate features
json or toml or yaml only.Expand description
A scalar’s processed value and how it was written.
The value has its escapes, folding and chomping applied, as a String
field receives it.
Implementations§
Source§impl Scalar
impl Scalar
Sourcepub fn new(value: impl Into<String>, style: ScalarStyle) -> Self
pub fn new(value: impl Into<String>, style: ScalarStyle) -> Self
A scalar with its processed value, written in style, with no
syntax type.
Sourcepub fn with_syntax(self, syntax: ScalarSyntax) -> Self
pub fn with_syntax(self, syntax: ScalarSyntax) -> Self
This scalar with the type its format’s syntax gave it.
Sourcepub fn style(&self) -> ScalarStyle
pub fn style(&self) -> ScalarStyle
How the scalar was written.
Sourcepub fn syntax(&self) -> Option<ScalarSyntax>
pub fn syntax(&self) -> Option<ScalarSyntax>
The type the format’s syntax gave the scalar, if the format types a value that way.
Trait Implementations§
impl Eq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Forget for Scalar
impl Freeze for Scalar
impl Move for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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