pub struct OAuthError {
pub error: OAuthErrorCode,
pub error_description: Option<String>,
pub error_uri: Option<String>,
}Expand description
OAuth 2.0 error response per RFC 6749 Section 5.2
Serializes to the standard JSON error body returned by token and other OAuth endpoints:
{ "error": "invalid_grant", "error_description": "..." }Fields§
§error: OAuthErrorCodeMachine-readable error code
error_description: Option<String>Human-readable ASCII text providing additional information
error_uri: Option<String>URI of a web page with information about the error
Implementations§
Source§impl OAuthError
impl OAuthError
Sourcepub fn new(error: OAuthErrorCode) -> OAuthError
pub fn new(error: OAuthErrorCode) -> OAuthError
Creates a new error with the given code and no description
Sourcepub fn with_description(self, description: impl Into<String>) -> OAuthError
pub fn with_description(self, description: impl Into<String>) -> OAuthError
Sets the human-readable error_description
Sourcepub fn with_error_uri(self, uri: impl Into<String>) -> OAuthError
pub fn with_error_uri(self, uri: impl Into<String>) -> OAuthError
Sets the error_uri pointing to a web page with details about the error
Trait Implementations§
Source§impl Clone for OAuthError
impl Clone for OAuthError
Source§fn clone(&self) -> OAuthError
fn clone(&self) -> OAuthError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuthError
impl Debug for OAuthError
Source§impl<'de> Deserialize<'de> for OAuthError
impl<'de> Deserialize<'de> for OAuthError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OAuthError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OAuthError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OAuthError
impl Display for OAuthError
impl Eq for OAuthError
Source§impl Error for OAuthError
impl Error for OAuthError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<OAuthError> for ClientError
impl From<OAuthError> for ClientError
Source§fn from(err: OAuthError) -> Self
fn from(err: OAuthError) -> Self
Converts to this type from the input type.
Source§impl From<OAuthErrorCode> for OAuthError
impl From<OAuthErrorCode> for OAuthError
Source§fn from(error: OAuthErrorCode) -> OAuthError
fn from(error: OAuthErrorCode) -> OAuthError
Converts to this type from the input type.
Source§impl PartialEq for OAuthError
impl PartialEq for OAuthError
Source§impl Serialize for OAuthError
impl Serialize for OAuthError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for OAuthError
Auto Trait Implementations§
impl Freeze for OAuthError
impl RefUnwindSafe for OAuthError
impl Send for OAuthError
impl Sync for OAuthError
impl Unpin for OAuthError
impl UnsafeUnpin for OAuthError
impl UnwindSafe for OAuthError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.