pub struct ProblemDetails { /* private fields */ }Expand description
Structured RFC 9457 Problem Details payload.
Implementations§
Source§impl ProblemDetails
Construction, fluent builders, and response application for ProblemDetails.
impl ProblemDetails
Construction, fluent builders, and response application for ProblemDetails.
Sourcepub fn from_status(status: HttpStatus) -> Self
pub fn from_status(status: HttpStatus) -> Self
Creates a new ProblemDetails with status and its standard HTTP title.
§Arguments
HttpStatus- HTTP error status.
§Returns
Self- Constructed Problem Details object.
Sourcepub fn new<T>(status: usize, title: T) -> Self
pub fn new<T>(status: usize, title: T) -> Self
Creates a new ProblemDetails with explicit numeric status code and title.
§Arguments
usize- HTTP status code.T- Human-readable title.
§Returns
Self- Constructed Problem Details object.
Sourcepub fn with_detail<S>(self, detail: S) -> Self
pub fn with_detail<S>(self, detail: S) -> Self
Sourcepub fn with_instance<S>(self, instance: S) -> Self
pub fn with_instance<S>(self, instance: S) -> Self
Sourcepub fn with_extension<K>(self, key: K, value: Value) -> Self
pub fn with_extension<K>(self, key: K, value: Value) -> Self
Sourcepub fn to_json_bytes(&self) -> Vec<u8> ⓘ
pub fn to_json_bytes(&self) -> Vec<u8> ⓘ
Sourcepub fn write_to_response(&self, response: &mut Response)
pub fn write_to_response(&self, response: &mut Response)
Writes this ProblemDetails directly into a Hyperlane Response.
§Arguments
&mut Response- Target HTTP response.
Sourcepub fn apply(&self, ctx: &mut Context)
pub fn apply(&self, ctx: &mut Context)
Writes this ProblemDetails into ctx.get_mut_response(), automatically filling instance from request path if unset.
§Arguments
&mut Context- Active Hyperlane context.
Source§impl ProblemDetails
impl ProblemDetails
pub fn get_problem_type(&self) -> &String
pub fn get_mut_problem_type(&mut self) -> &mut String
pub fn set_problem_type(&mut self, val: String) -> &mut Self
pub fn get_title(&self) -> &String
pub fn get_mut_title(&mut self) -> &mut String
pub fn set_title(&mut self, val: String) -> &mut Self
pub fn get_status(&self) -> usize
pub fn get_mut_status(&mut self) -> &mut usize
pub fn set_status(&mut self, val: usize) -> &mut Self
pub fn get_detail(&self) -> String
pub fn try_get_detail(&self) -> &Option<String>
pub fn get_mut_detail(&mut self) -> &mut Option<String>
pub fn set_detail(&mut self, val: Option<String>) -> &mut Self
pub fn get_instance(&self) -> String
pub fn try_get_instance(&self) -> &Option<String>
pub fn get_mut_instance(&mut self) -> &mut Option<String>
pub fn set_instance(&mut self, val: Option<String>) -> &mut Self
pub fn get_extensions(&self) -> &BTreeMap<String, Value>
pub fn get_mut_extensions(&mut self) -> &mut BTreeMap<String, Value>
pub fn set_extensions(&mut self, val: BTreeMap<String, Value>) -> &mut Self
Trait Implementations§
Source§impl Clone for ProblemDetails
impl Clone for ProblemDetails
Source§impl Debug for ProblemDetails
impl Debug for ProblemDetails
Source§impl<'de> Deserialize<'de> for ProblemDetails
impl<'de> Deserialize<'de> for ProblemDetails
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
impl Eq for ProblemDetails
Source§impl PartialEq for ProblemDetails
impl PartialEq for ProblemDetails
Source§impl Serialize for ProblemDetails
impl Serialize for ProblemDetails
impl StructuralPartialEq for ProblemDetails
Auto Trait Implementations§
impl Forget for ProblemDetails
impl Freeze for ProblemDetails
impl Move for ProblemDetails
impl RefUnwindSafe for ProblemDetails
impl Send for ProblemDetails
impl Sync for ProblemDetails
impl Unpin for ProblemDetails
impl UnsafeUnpin for ProblemDetailswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for ProblemDetails
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.