pub struct ErrorContext {
pub operation: Option<String>,
pub model: Option<String>,
pub field: Option<String>,
pub sql: Option<String>,
pub suggestions: Vec<Suggestion>,
pub help: Option<String>,
pub related: Vec<String>,
}Expand description
Additional context for an error.
Fields§
§operation: Option<String>The operation that was being performed.
model: Option<String>The model involved.
field: Option<String>The field involved.
sql: Option<String>The SQL query (if available).
suggestions: Vec<Suggestion>Suggestions for fixing the error.
help: Option<String>Help text.
Related errors.
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn suggestion(self, suggestion: Suggestion) -> Self
pub fn suggestion(self, suggestion: Suggestion) -> Self
Add a suggestion.
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Source§impl Default for ErrorContext
impl Default for ErrorContext
Source§fn default() -> ErrorContext
fn default() -> ErrorContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnwindSafe for ErrorContext
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)