pub struct ErrorResponse {
pub code: String,
pub message: String,
pub details: Option<String>,
}Expand description
Generic API error response.
Fields§
§code: StringError code (e.g., “SESSION_NOT_FOUND”).
message: StringHuman-readable error message.
details: Option<String>Additional details (optional).
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn with_details(self, details: impl Into<String>) -> Self
pub fn session_not_found(id: &str) -> Self
pub fn invalid_state(state: SessionState) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
pub fn bad_request(message: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ErrorResponse
impl Clone for ErrorResponse
Source§fn clone(&self) -> ErrorResponse
fn clone(&self) -> ErrorResponse
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 ErrorResponse
impl Debug for ErrorResponse
Auto Trait Implementations§
impl Freeze for ErrorResponse
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnsafeUnpin for ErrorResponse
impl UnwindSafe for ErrorResponse
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