pub struct EngineError {
pub code: ErrorCode,
pub message: String,
pub path: Option<String>,
pub details: Value,
}Expand description
A structured engine error. Errors never carry a fabricated successful result.
Fields§
§code: ErrorCode§message: String§path: Option<String>JSON-pointer-like path to the offending input, when known.
details: ValueAdditional structured detail. Always a JSON object.
Implementations§
Source§impl EngineError
impl EngineError
pub fn new(code: ErrorCode, message: impl Into<String>) -> EngineError
pub fn malformed(message: impl Into<String>) -> EngineError
pub fn domain(message: impl Into<String>) -> EngineError
pub fn division_by_zero(message: impl Into<String>) -> EngineError
pub fn unsupported(message: impl Into<String>) -> EngineError
pub fn resource(message: impl Into<String>) -> EngineError
pub fn internal(message: impl Into<String>) -> EngineError
pub fn cancelled() -> EngineError
pub fn with_path(self, path: impl Into<String>) -> EngineError
pub fn with_details(self, details: Value) -> EngineError
Sourcepub fn batch_dependency(node: &str, source: &EngineError) -> EngineError
pub fn batch_dependency(node: &str, source: &EngineError) -> EngineError
Wrap another error as a batch dependency failure.
Trait Implementations§
Source§impl Clone for EngineError
impl Clone for EngineError
Source§fn clone(&self) -> EngineError
fn clone(&self) -> EngineError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EngineError
impl Debug for EngineError
Source§impl<'de> Deserialize<'de> for EngineError
impl<'de> Deserialize<'de> for EngineError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
1.30.0 · 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()
Source§impl PartialEq for EngineError
impl PartialEq for EngineError
Source§impl Serialize for EngineError
impl Serialize for EngineError
impl StructuralPartialEq for EngineError
Auto Trait Implementations§
impl Freeze for EngineError
impl RefUnwindSafe for EngineError
impl Send for EngineError
impl Sync for EngineError
impl Unpin for EngineError
impl UnsafeUnpin for EngineError
impl UnwindSafe for EngineError
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