pub(super) struct ScalarText<'a> {
text: &'a str,
position: Position,
}Expand description
Text written plain when that is safe, and quoted otherwise.
The check is conservative: over quoting never changes a value, under quoting can. A value that YAML 1.1 reads as a boolean is quoted.
Fields§
§text: &'a str§position: PositionImplementations§
Source§impl<'a> ScalarText<'a>
impl<'a> ScalarText<'a>
Source§impl ScalarText<'_>
impl ScalarText<'_>
Source§impl ScalarText<'_>
impl ScalarText<'_>
Sourcefn needs_double_quotes(&self) -> bool
fn needs_double_quotes(&self) -> bool
Double quotes are needed only for text that must be escaped; single
quotes carry everything else verbatim, with ' doubled.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ScalarText<'a>
impl<'a> RefUnwindSafe for ScalarText<'a>
impl<'a> Send for ScalarText<'a>
impl<'a> Sync for ScalarText<'a>
impl<'a> Unpin for ScalarText<'a>
impl<'a> UnsafeUnpin for ScalarText<'a>
impl<'a> UnwindSafe for ScalarText<'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