Struct oauth2::StandardErrorResponse
source · pub struct StandardErrorResponse<T: ErrorResponseType> { /* private fields */ }
Expand description
Error response returned by server after requesting an access token.
The fields in this structure are defined in
Section 5.2 of RFC 6749. This
trait is parameterized by a ErrorResponseType
to support error types specific to future OAuth2
authentication schemes and extensions.
Implementations§
source§impl<T: ErrorResponseType> StandardErrorResponse<T>
impl<T: ErrorResponseType> StandardErrorResponse<T>
sourcepub fn new(
error: T,
error_description: Option<String>,
error_uri: Option<String>,
) -> Self
pub fn new( error: T, error_description: Option<String>, error_uri: Option<String>, ) -> Self
Instantiate a new ErrorResponse
.
§Arguments
error
- REQUIRED. A single ASCII error code deserialized to the generic parameter.ErrorResponseType
.error_description
- OPTIONAL. Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred. Values for this parameter MUST NOT include characters outside the set%x20-21 / %x23-5B / %x5D-7E
.error_uri
- OPTIONAL. A URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error. Values for the “error_uri” parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set%x21 / %x23-5B / %x5D-7E
.
sourcepub fn error(&self) -> &T
pub fn error(&self) -> &T
REQUIRED. A single ASCII error code deserialized to the generic parameter
ErrorResponseType
.
sourcepub fn error_description(&self) -> Option<&String>
pub fn error_description(&self) -> Option<&String>
OPTIONAL. Human-readable ASCII text providing additional information, used to assist
the client developer in understanding the error that occurred. Values for this
parameter MUST NOT include characters outside the set %x20-21 / %x23-5B / %x5D-7E
.
sourcepub fn error_uri(&self) -> Option<&String>
pub fn error_uri(&self) -> Option<&String>
OPTIONAL. URI identifying a human-readable web page with information about the error,
used to provide the client developer with additional information about the error.
Values for the “error_uri” parameter MUST conform to the URI-reference syntax and
thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E
.
Trait Implementations§
source§impl<T: Clone + ErrorResponseType> Clone for StandardErrorResponse<T>
impl<T: Clone + ErrorResponseType> Clone for StandardErrorResponse<T>
source§fn clone(&self) -> StandardErrorResponse<T>
fn clone(&self) -> StandardErrorResponse<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug + ErrorResponseType> Debug for StandardErrorResponse<T>
impl<T: Debug + ErrorResponseType> Debug for StandardErrorResponse<T>
source§impl<'de, T> Deserialize<'de> for StandardErrorResponse<T>where
T: ErrorResponseType,
impl<'de, T> Deserialize<'de> for StandardErrorResponse<T>where
T: ErrorResponseType,
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<TE> Display for StandardErrorResponse<TE>where
TE: ErrorResponseType + Display,
impl<TE> Display for StandardErrorResponse<TE>where
TE: ErrorResponseType + Display,
source§impl<T: PartialEq + ErrorResponseType> PartialEq for StandardErrorResponse<T>
impl<T: PartialEq + ErrorResponseType> PartialEq for StandardErrorResponse<T>
source§fn eq(&self, other: &StandardErrorResponse<T>) -> bool
fn eq(&self, other: &StandardErrorResponse<T>) -> bool
self
and other
values to be equal, and is used
by ==
.