Enum EngineError

Source
pub enum EngineError {
    InputError(InputError),
    SinkError(Box<dyn Error + Send + Sync>),
    DepthBelowZero(usize, DepthError),
    DepthAboveLimit(usize, DepthError),
    MissingClosingCharacter(),
    MissingOpeningCharacter(),
    MissingItem(),
    MalformedStringQuotes(usize),
    NotSupported(UnsupportedFeatureError),
    InternalError(InternalRsonpathError),
}
Expand description

Error enum for all types of errors that can be reported during engine execution.

NOTE: Most errors are not guaranteed to be raised for every JSON document that is malformed in the respective manner. The engine may ignore such errors and simply produce incorrect results for invalid documents.

Variants§

§

InputError(InputError)

Error while reading from the supplied Input implementation.

§

SinkError(Box<dyn Error + Send + Sync>)

Error while writing to the supplied Sink implementation.

§

DepthBelowZero(usize, DepthError)

Document depth fell below zero, which can only happen if there are more closing than opening braces. The inner usize value indicates the position of the mismatched closing character.

§

DepthAboveLimit(usize, DepthError)

The depth limit was reached – the document is too nested. The inner usize value indicates the position of the opening character which caused the overflow.

§

MissingClosingCharacter()

The engine reached end of the document while depth was positive. This means that some of the opening characters do not have matching closing characters.

§

MissingOpeningCharacter()

The engine reached a structural character that should occur only in an object or list, but there was no preceding opening character.

§

MissingItem()

The engine found a query match, but no value associated with it.

§

MalformedStringQuotes(usize)

An error occurred when trying to parse a member name terminated by a particular colon character. The inner usize value should be set to the byte index of the colon.

§

NotSupported(UnsupportedFeatureError)

Engine error that occurred due to a known limitation.

§

InternalError(InternalRsonpathError)

Irrecoverable error due to a broken invariant or assumption. The engine returns these instead of panicking.

Trait Implementations§

Source§

impl Debug for EngineError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EngineError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for EngineError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<InputError> for EngineError

Source§

fn from(source: InputError) -> Self

Converts to this type from the input type.
Source§

impl From<InternalRsonpathError> for EngineError

Source§

fn from(source: InternalRsonpathError) -> Self

Converts to this type from the input type.
Source§

impl From<UnsupportedFeatureError> for EngineError

Source§

fn from(source: UnsupportedFeatureError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.