pub struct MarkedYaml<'input> {
pub span: Span,
pub data: YamlData<'input, MarkedYaml<'input>>,
}Expand description
A YAML node with Spans pointing to the start of the node.
This structure does not implement functions to operate on the YAML object. To access those,
refer to the Self::data field.
§Warning
In order to allow indexing by content in mappings, equality comparisons for this structure
ignore the Span.
Fields§
§span: SpanThe span indicating where in the input stream the object is.
The markers are relative to the start of the input stream that was given to the parser, not to the start of the document within the input stream.
data: YamlData<'input, MarkedYaml<'input>>The YAML contents of the node.
Implementations§
Source§impl<'input> MarkedYaml<'input>
impl<'input> MarkedYaml<'input>
Sourcepub fn value_from_str(v: &'input str) -> Self
pub fn value_from_str(v: &'input str) -> Self
Convert a string to a scalar node.
See YamlData::value_from_str for more details.
The returned node is created with a default Span.
Sourcepub fn scalar_from_string(v: String) -> Self
pub fn scalar_from_string(v: String) -> Self
Same as Self::value_from_str but uses a String instead.
See YamlData::value_from_str for more details.
The returned node is created with a default Span.
Sourcepub fn value_from_cow(v: Cow<'input, str>) -> Self
pub fn value_from_cow(v: Cow<'input, str>) -> Self
Same as Self::value_from_str but uses a Cow instead.
See YamlData::value_from_str for more details.
The returned node is created with a default Span.
Sourcepub fn value_from_cow_and_metadata(
v: Cow<'input, str>,
style: ScalarStyle,
tag: Option<&Cow<'input, Tag>>,
) -> Self
pub fn value_from_cow_and_metadata( v: Cow<'input, str>, style: ScalarStyle, tag: Option<&Cow<'input, Tag>>, ) -> Self
Convert a string to a scalar node, abiding by the given metadata.
The variant returned by this function will always be a YamlData::Value, unless the tag
forces a particular type and the representation cannot be parsed as this type, in which
case it returns a YamlData::BadValue.
The returned node is created with a default Span.
Trait Implementations§
Source§impl AnnotatedNode for MarkedYaml<'_>
impl AnnotatedNode for MarkedYaml<'_>
Source§type HashKey<'a> = MarkedYaml<'a>
type HashKey<'a> = MarkedYaml<'a>
YamlData::Mapping variant.Source§fn parse_representation_recursive(&mut self) -> bool
fn parse_representation_recursive(&mut self) -> bool
Source§impl<'input> Clone for MarkedYaml<'input>
impl<'input> Clone for MarkedYaml<'input>
Source§fn clone(&self) -> MarkedYaml<'input>
fn clone(&self) -> MarkedYaml<'input>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'input> Debug for MarkedYaml<'input>
impl<'input> Debug for MarkedYaml<'input>
Source§impl<'a> From<YamlData<'a, MarkedYaml<'a>>> for MarkedYaml<'a>
impl<'a> From<YamlData<'a, MarkedYaml<'a>>> for MarkedYaml<'a>
Source§fn from(value: YamlData<'a, MarkedYaml<'a>>) -> Self
fn from(value: YamlData<'a, MarkedYaml<'a>>) -> Self
Source§impl Hash for MarkedYaml<'_>
impl Hash for MarkedYaml<'_>
Source§impl<'input> LoadableYamlNode<'input> for MarkedYaml<'input>
impl<'input> LoadableYamlNode<'input> for MarkedYaml<'input>
Source§type HashKey = MarkedYaml<'input>
type HashKey = MarkedYaml<'input>
Source§fn from_bare_yaml(yaml: Yaml<'input>) -> Self
fn from_bare_yaml(yaml: Yaml<'input>) -> Self
Source§fn is_sequence(&self) -> bool
fn is_sequence(&self) -> bool
Source§fn is_mapping(&self) -> bool
fn is_mapping(&self) -> bool
Source§fn is_badvalue(&self) -> bool
fn is_badvalue(&self) -> bool
BadValue.Source§fn into_tagged(self, tag: Cow<'input, Tag>) -> Self
fn into_tagged(self, tag: Cow<'input, Tag>) -> Self
Source§fn sequence_mut(&mut self) -> &mut Vec<Self>
fn sequence_mut(&mut self) -> &mut Vec<Self>
Source§fn mapping_mut(&mut self) -> &mut LinkedHashMap<Self::HashKey, Self>
fn mapping_mut(&mut self) -> &mut LinkedHashMap<Self::HashKey, Self>
Source§fn take(&mut self) -> Self
fn take(&mut self) -> Self
Self, leaving a BadValue in its place.