Struct http_api_problem::ApiErrorBuilder [−][src]
Fields
message: Option<String>A message that describes the error in a human readable form.
In an HttpApiProblem this becomes the detail in most cases.
If None:
- If there is a cause, this will become the details
- Otherwise there will be no details
status: StatusCodeThe suggested status code for the server to be returned to the client
Defaults to 500.
type_url: Option<String>A URL that points to a detailed description of the error. If not
set it will most probably become httpstatus.es.com/XXX when
the problem response is generated.
fields: HashMap<String, Value>Additional JSON encodable information. It is up to the server how and if it adds the given information.
title: Option<String>This is an optional title which can be used to create a valuable output for consumers.
source: Option<Box<dyn Error + Send + Sync + 'static>>Implementations
impl ApiErrorBuilder[src]
pub fn status<S: Into<StatusCode>>(self, status: S) -> Self[src]
pub fn title<T: Into<String>>(self, title: T) -> Self[src]
pub fn message<M: Into<String>>(self, message: M) -> Self[src]
pub fn type_url<U: Into<String>>(self, type_url: U) -> Self[src]
pub fn field<T: Into<String>, V: Serialize>(self, name: T, value: V) -> Self[src]
Adds a serializable field. If the serialization fails nothing will be added.
An already present field with the same name will be replaced.
pub fn source<E: Error + Send + Sync + 'static>(self, cause: E) -> Self[src]
pub fn finish(self) -> ApiError[src]
Trait Implementations
impl Default for ApiErrorBuilder[src]
Auto Trait Implementations
impl !RefUnwindSafe for ApiErrorBuilder
impl Send for ApiErrorBuilder
impl Sync for ApiErrorBuilder
impl Unpin for ApiErrorBuilder
impl !UnwindSafe for ApiErrorBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,