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 more