pub enum ResolveError {
UndefinedAlias {
alias: String,
},
RecursiveAlias {
alias: String,
},
InvalidMergeOperand {
operand: String,
},
DuplicateKey {
first: String,
second: String,
},
KeyCollision {
first: String,
second: String,
},
InvalidSetContent {
content: String,
},
InvalidSetMember {
member: String,
},
NonNullSetValue {
member: String,
value: String,
},
InvalidPairsItem {
tag: String,
item: String,
},
InvalidPairsContent {
tag: String,
content: String,
},
UnresolvedAlias {
alias: String,
},
ExtraNode {
node: String,
},
}Expand description
An error resolving aliases or merge keys, or converting a node to a
YamlValue that cannot hold it.
Variants§
UndefinedAlias
An alias refers to an anchor that is not defined before it in the document.
RecursiveAlias
An alias refers to an anchor it is nested in, so expanding it would not terminate.
InvalidMergeOperand
A merge key (<<) operand is neither a mapping nor an alias to
one.
DuplicateKey
A mapping has two equal keys, such as a and 'a', or a key and
an alias to an equal node, so it cannot keep both values. A direct
key shadowing a key from a merge key (<<) is not a duplicate. The
members of a !!set and the keys of a !!omap have to be distinct
too.
Fields
KeyCollision
Two distinct keys of a mapping have the same string form, such as
the int 1 and the string '1', so they cannot both be kept in a
YamlValue::Mapping. The same goes for the members of a
YamlValue::Set and the keys of a YamlValue::OrderedMapping.
Fields
InvalidSetContent
The content of a !!set is not a mapping, so it has no members.
InvalidSetMember
A !!set member is not a scalar, so it cannot be kept in a
YamlValue::Set.
NonNullSetValue
A !!set member has a value other than null, which a
YamlValue::Set cannot keep.
InvalidPairsItem
An item of a !!omap or !!pairs sequence is not a mapping with a
single entry.
Fields
InvalidPairsContent
The content of a !!omap or !!pairs is not a sequence, so it has
no entries.
UnresolvedAlias
YamlValue::cast met an alias, which it cannot resolve without
the document’s anchors. YamlValue::from_document and
DocumentResolvedExt::get_resolved resolve aliases.
ExtraNode
A document, key, value, sequence entry or tagged node holds more
than one node, as in k: [q] x, which YAML does not allow but the
parser accepts. A YamlValue can only keep one of them.
Trait Implementations§
Source§impl Clone for ResolveError
impl Clone for ResolveError
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
impl Eq for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()