pub struct ErrorDefinition {
pub type_: ErrorType,
pub title: Option<String>,
pub status: Value,
pub detail: Option<String>,
pub instance: Option<String>,
}Expand description
Represents the definition an error to raise
Fields§
§type_: ErrorTypeGets/sets an uri that reference the type of the described error
title: Option<String>Gets/sets a short, human-readable summary of the error type.It SHOULD NOT change from occurrence to occurrence of the error, except for purposes of localization
status: ValueGets/sets the status code produced by the described error
detail: Option<String>Gets/sets a human-readable explanation specific to this occurrence of the error.
instance: Option<String>Gets/sets a URI reference that identifies the specific occurrence of the error. It may or may not yield further information if dereferenced.
Implementations§
Source§impl ErrorDefinition
impl ErrorDefinition
Sourcepub fn new(
type_: &str,
title: &str,
status: Value,
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn new( type_: &str, title: &str, status: Value, detail: Option<String>, instance: Option<String>, ) -> Self
Initializes a new ErrorDefinition
Sourcepub fn configuration_error(
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn configuration_error( detail: Option<String>, instance: Option<String>, ) -> Self
Creates a new configuration_error
Sourcepub fn is_configuration_error(&self) -> bool
pub fn is_configuration_error(&self) -> bool
Checks if this error is a configuration_error
Sourcepub fn validation_error(
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn validation_error( detail: Option<String>, instance: Option<String>, ) -> Self
Creates a new validation_error
Sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Checks if this error is a validation_error
Sourcepub fn expression_error(
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn expression_error( detail: Option<String>, instance: Option<String>, ) -> Self
Creates a new expression_error
Sourcepub fn is_expression_error(&self) -> bool
pub fn is_expression_error(&self) -> bool
Checks if this error is a expression_error
Sourcepub fn authentication_error(
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn authentication_error( detail: Option<String>, instance: Option<String>, ) -> Self
Creates a new authentication_error
Sourcepub fn is_authentication_error(&self) -> bool
pub fn is_authentication_error(&self) -> bool
Checks if this error is a authentication_error
Creates a new authorization_error
Checks if this error is a authorization_error
Sourcepub fn timeout_error(detail: Option<String>, instance: Option<String>) -> Self
pub fn timeout_error(detail: Option<String>, instance: Option<String>) -> Self
Creates a new timeout_error
Sourcepub fn is_timeout_error(&self) -> bool
pub fn is_timeout_error(&self) -> bool
Checks if this error is a timeout_error
Sourcepub fn communication_error(
detail: Option<String>,
instance: Option<String>,
) -> Self
pub fn communication_error( detail: Option<String>, instance: Option<String>, ) -> Self
Creates a new communication_error
Sourcepub fn is_communication_error(&self) -> bool
pub fn is_communication_error(&self) -> bool
Checks if this error is a communication_error
Sourcepub fn runtime_error(detail: Option<String>, instance: Option<String>) -> Self
pub fn runtime_error(detail: Option<String>, instance: Option<String>) -> Self
Creates a new runtime_error
Sourcepub fn is_runtime_error(&self) -> bool
pub fn is_runtime_error(&self) -> bool
Checks if this error is a runtime_error
Trait Implementations§
Source§impl Clone for ErrorDefinition
impl Clone for ErrorDefinition
Source§fn clone(&self) -> ErrorDefinition
fn clone(&self) -> ErrorDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ErrorDefinition
impl Debug for ErrorDefinition
Source§impl Default for ErrorDefinition
impl Default for ErrorDefinition
Source§fn default() -> ErrorDefinition
fn default() -> ErrorDefinition
Source§impl<'de> Deserialize<'de> for ErrorDefinition
impl<'de> Deserialize<'de> for ErrorDefinition
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>,
Source§impl PartialEq for ErrorDefinition
impl PartialEq for ErrorDefinition
Source§fn eq(&self, other: &ErrorDefinition) -> bool
fn eq(&self, other: &ErrorDefinition) -> bool
self and other values to be equal, and is used by ==.