pub enum Error {
FailedToParseIndex {
position: usize,
offset: usize,
source: ParseIndexError,
},
OutOfBounds {
position: usize,
offset: usize,
source: OutOfBoundsError,
},
}
Expand description
Possible error returned from Assign
implementations for
serde_json::Value
and
toml::Value
.
Variants§
FailedToParseIndex
Fields
§
source: ParseIndexError
The source ParseIndexError
OutOfBounds
A Token
within the Pointer
contains an
Index
which is out of bounds.
The current or resulting array’s length is less than the index.
Fields
§
source: OutOfBoundsError
The source OutOfBoundsError
Implementations§
Source§impl Error
impl Error
Sourcepub fn position(&self) -> usize
pub fn position(&self) -> usize
The position (token index) of the Token
which was out of bounds
Sourcepub fn offset(&self) -> usize
pub fn offset(&self) -> usize
Offset (in bytes) of the partial pointer starting with the invalid token.
Sourcepub fn is_out_of_bounds(&self) -> bool
pub fn is_out_of_bounds(&self) -> bool
Returns true
if the error is OutOfBounds
.
Sourcepub fn is_failed_to_parse_index(&self) -> bool
pub fn is_failed_to_parse_index(&self) -> bool
Returns true
if the error is FailedToParseIndex
.
Trait Implementations§
Source§impl Diagnostic for Error
impl Diagnostic for Error
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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