pub struct JsonError {
pub error: String,
pub message: String,
pub code: String,
pub remediation: Option<String>,
}Expand description
Error response format for JSON mode
Fields§
§error: String§message: String§code: String§remediation: Option<String>Implementations§
Source§impl JsonError
impl JsonError
pub fn new(category: &str, message: &str, code: &str) -> Self
pub fn with_remediation(self, remediation: &str) -> Self
Sourcepub fn database_not_found(path: &str) -> Self
pub fn database_not_found(path: &str) -> Self
Database not found error with remediation
Sourcepub fn function_not_found(name: &str) -> Self
pub fn function_not_found(name: &str) -> Self
Function not found error with remediation
Sourcepub fn block_not_found(id: usize) -> Self
pub fn block_not_found(id: usize) -> Self
Block not found error
Sourcepub fn path_not_found(id: &str) -> Self
pub fn path_not_found(id: &str) -> Self
Path not found error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonError
impl RefUnwindSafe for JsonError
impl Send for JsonError
impl Sync for JsonError
impl Unpin for JsonError
impl UnsafeUnpin for JsonError
impl UnwindSafe for JsonError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more