pub struct Exception {
pub type: String,
pub title: Option<String>,
pub status: Option<u16>,
pub detail: Option<String>,
pub instance: Option<String>,
pub additional_properties: Map<String, Value>,
}Expand description
Exception based on RFC 7807
Fields§
§type: StringA URI reference that identifies the problem type.
title: Option<String>A short, human-readable summary of the problem type.
status: Option<u16>The HTTP status code generated by the origin server for this occurrence of the problem.
detail: Option<String>A human-readable explanation specific to this occurrence of the problem.
instance: Option<String>A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
additional_properties: Map<String, Value>Implementations§
Source§impl Exception
impl Exception
pub fn new(type: impl ToString) -> Self
pub fn new_from_status(status: u16) -> Self
pub fn title(self, title: impl ToString) -> Self
pub fn status(self, status: u16) -> Self
pub fn detail(self, detail: impl ToString) -> Self
pub fn instance(self, instance: impl ToString) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Exception
impl<'de> Deserialize<'de> for Exception
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 Error for Exception
impl Error for Exception
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()
impl Eq for Exception
impl StructuralPartialEq for Exception
Auto Trait Implementations§
impl Freeze for Exception
impl RefUnwindSafe for Exception
impl Send for Exception
impl Sync for Exception
impl Unpin for Exception
impl UnsafeUnpin for Exception
impl UnwindSafe for Exception
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