#[non_exhaustive]pub struct Error {
pub reason: String,
pub error_uuid: String,
pub message: String,
pub error_time: Option<Timestamp>,
pub details: HashMap<String, String>,
/* private fields */
}
Expand description
Represent a user-facing Error.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.reason: String
A title that explains the reason for the error.
error_uuid: String
A unique identifier for this specific error, allowing it to be traced throughout the system in logs and API responses.
message: String
A message containing more information about the error that occurred.
error_time: Option<Timestamp>
The time when the error occurred.
details: HashMap<String, String>
Additional information about the error.
Implementations§
Source§impl Error
impl Error
pub fn new() -> Self
Sourcepub fn set_reason<T: Into<String>>(self, v: T) -> Self
pub fn set_reason<T: Into<String>>(self, v: T) -> Self
Sets the value of reason.
Sourcepub fn set_error_uuid<T: Into<String>>(self, v: T) -> Self
pub fn set_error_uuid<T: Into<String>>(self, v: T) -> Self
Sets the value of error_uuid.
Sourcepub fn set_message<T: Into<String>>(self, v: T) -> Self
pub fn set_message<T: Into<String>>(self, v: T) -> Self
Sets the value of message.
Sourcepub fn set_error_time<T>(self, v: T) -> Self
pub fn set_error_time<T>(self, v: T) -> Self
Sets the value of error_time.
Sourcepub fn set_or_clear_error_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_error_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of error_time.
Sourcepub fn set_details<T, K, V>(self, v: T) -> Self
pub fn set_details<T, K, V>(self, v: T) -> Self
Sets the value of details.
Trait Implementations§
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