pub struct YamlScalar(/* private fields */);Expand description
A scalar value node. Its leaves are the per-physical-line content fragments
(YAML_SCALAR_TEXT) interleaved with NEWLINE (and, for embedded hashpipe,
line-prefix) tokens; raw reassembles them.
Implementations§
Source§impl YamlScalar
impl YamlScalar
pub fn cast(node: SyntaxNode) -> Option<Self>
Sourcepub fn raw(&self) -> String
pub fn raw(&self) -> String
The raw source bytes of the scalar (all leaves concatenated), including any quotes / block header and embedded line breaks.
pub fn style(&self) -> YamlScalarStyle
Sourcepub fn value(&self) -> String
pub fn value(&self) -> String
The cooked logical string: quotes stripped, escapes decoded, multi-line
scalars folded per YAML 1.2. Block scalars (|/>) are returned raw
(their cooking needs parent indent context).
pub fn text_range(&self) -> TextRange
pub fn syntax(&self) -> &SyntaxNode
Trait Implementations§
Source§impl Clone for YamlScalar
impl Clone for YamlScalar
Source§fn clone(&self) -> YamlScalar
fn clone(&self) -> YamlScalar
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 YamlScalar
impl Debug for YamlScalar
impl Eq for YamlScalar
Source§impl Hash for YamlScalar
impl Hash for YamlScalar
Source§impl PartialEq for YamlScalar
impl PartialEq for YamlScalar
Source§fn eq(&self, other: &YamlScalar) -> bool
fn eq(&self, other: &YamlScalar) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for YamlScalar
Auto Trait Implementations§
impl !RefUnwindSafe for YamlScalar
impl !Send for YamlScalar
impl !Sync for YamlScalar
impl !UnwindSafe for YamlScalar
impl Freeze for YamlScalar
impl Unpin for YamlScalar
impl UnsafeUnpin for YamlScalar
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