pub enum GffPathError {
EmptyPath,
IndexAtRoot {
path: String,
},
NoSuchField {
at: String,
label: String,
},
AmbiguousLabel {
at: String,
label: String,
count: usize,
},
IndexOutOfRange {
at: String,
index: usize,
len: usize,
},
NotAList {
at: String,
actual: &'static str,
},
NotAStruct {
at: String,
actual: &'static str,
},
TypeMismatch {
at: String,
existing: &'static str,
replacement: &'static str,
},
AlreadyExists {
at: String,
},
WrongSegmentKind {
at: String,
operation: &'static str,
expected: &'static str,
},
}Expand description
A path that does not resolve, or an edit the tree will not take.
A Result rather than a hit-plus-diagnostics pair. A tier walk can half
succeed, answering from a lower tier while a higher one was unreadable, and
both halves matter. Addressing a path cannot: it arrives or it does not, for
one reason.
Variants§
EmptyPath
A path with no segments names nothing to act on.
IndexAtRoot
A path started by indexing, with no list yet in hand.
NoSuchField
The struct has no field under that label.
AmbiguousLabel
The struct carries that label more than once.
Which copy the caller meant is not recoverable from the path, and the copies are not known to agree on anything but their value today.
Fields
IndexOutOfRange
The list is shorter than the index.
Fields
NotAList
A field was indexed and is not a list.
NotAStruct
A field was descended into and is not a struct.
TypeMismatch
The replacement is a different type from what the field holds.
The existing field’s type is the only oracle available here. The
per-format schemas that could answer “what should this label be” live
in rakata-generics, above this crate, and asking that question is
validation, which belongs to lint.
Fields
AlreadyExists
insert was given a label the struct already carries.
WrongSegmentKind
A field operation ended at a list index, or the reverse.
Trait Implementations§
Source§impl Clone for GffPathError
impl Clone for GffPathError
Source§fn clone(&self) -> GffPathError
fn clone(&self) -> GffPathError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GffPathError
impl Debug for GffPathError
Source§impl Display for GffPathError
impl Display for GffPathError
Source§impl Error for GffPathError
impl Error for GffPathError
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()
Source§impl From<GffPathError> for GffDocumentError
impl From<GffPathError> for GffDocumentError
Source§fn from(source: GffPathError) -> Self
fn from(source: GffPathError) -> Self
Source§impl PartialEq for GffPathError
impl PartialEq for GffPathError
Source§fn eq(&self, other: &GffPathError) -> bool
fn eq(&self, other: &GffPathError) -> bool
self and other values to be equal, and is used by ==.