ProblemDetailsBuilder

Struct ProblemDetailsBuilder 

Source
pub struct ProblemDetailsBuilder;

Implementations§

Source§

impl ProblemDetailsBuilder

Source

pub fn build_not_found( detail: Option<impl Into<String>>, rtype: Option<impl Into<String>>, ) -> ProblemDetails

Source

pub fn build_bad_request( detail: Option<impl Into<String>>, rtype: Option<impl Into<String>>, ) -> ProblemDetails

Examples found in repository?
examples/custom_error_types.rs (lines 27-29)
26    fn into_problemdetails(&self) -> ProblemDetails {
27        ProblemDetailsBuilder::build_bad_request(
28            Some("test"),
29            None::<String>)
30    }
Source

pub fn build_server_error( detail: Option<impl Into<String>>, rtype: Option<impl Into<String>>, ) -> ProblemDetails

Source

pub fn build( status: StatusCode, title: String, detail: String, rtype: Option<impl Into<String>>, instance: Option<impl Into<String>>, ) -> ProblemDetails

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.