oauth2

Struct Client

Source
pub struct Client<TE, TR, TIR, RT, TRE, HasAuthUrl = EndpointNotSet, HasDeviceAuthUrl = EndpointNotSet, HasIntrospectionUrl = EndpointNotSet, HasRevocationUrl = EndpointNotSet, HasTokenUrl = EndpointNotSet>
where TE: ErrorResponse, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,
{ /* private fields */ }
Expand description

Stores the configuration for an OAuth2 client.

This type implements the Builder Pattern together with typestates to encode whether certain fields have been set that are prerequisites to certain authentication flows. For example, the authorization endpoint must be set via set_auth_uri() before authorize_url() can be called. Each endpoint has a corresponding generic type parameter (e.g., HasAuthUrl) used to statically enforce these dependencies. These generics are set automatically by the corresponding setter functions, and in most cases user code should not need to deal with them directly.

In addition to unconditional setters (e.g., set_auth_uri()), each endpoint has a corresponding conditional setter (e.g., set_auth_uri_option()) that sets a conditional typestate (EndpointMaybeSet). When the conditional typestate is set, endpoints can be used via fallible methods that return ConfigurationError::MissingUrl if an endpoint has not been set. This is useful in dynamic scenarios such as OpenID Connect Discovery, in which it cannot be determined until runtime whether an endpoint is configured.

§Error Types

To enable compile time verification that only the correct and complete set of errors for the Client function being invoked are exposed to the caller, the Client type is specialized on multiple implementations of the ErrorResponse trait. The exact ErrorResponse implementation returned varies by the RFC that the invoked Client function implements:

For example when revoking a token, error code unsupported_token_type (from RFC 7009) may be returned:

let res = client
    .revoke_token(AccessToken::new("some token".to_string()).into())
    .unwrap()
    .request(&http_client);

assert!(matches!(res, Err(
    RequestTokenError::ServerResponse(err)) if matches!(err.error(),
        RevocationErrorResponseType::UnsupportedTokenType)));

§Examples

See the crate root documentation for usage examples.

Implementations§

Source§

impl<TE, TR, TIR, RT, TRE> Client<TE, TR, TIR, RT, TRE, EndpointNotSet, EndpointNotSet, EndpointNotSet, EndpointNotSet, EndpointNotSet>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static,

Source

pub fn new(client_id: ClientId) -> Self

Initializes an OAuth2 client with the specified client ID.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Source

pub fn set_auth_type(self, auth_type: AuthType) -> Self

Set the type of client authentication used for communicating with the authorization server.

The default is to use HTTP Basic authentication, as recommended in Section 2.3.1 of RFC 6749. Note that if a client secret is omitted (i.e., set_client_secret() is not called), AuthType::RequestBody is used regardless of the auth_type passed to this function.

Source

pub fn set_auth_uri( self, auth_url: AuthUrl, ) -> Client<TE, TR, TIR, RT, TRE, EndpointSet, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

Set the authorization endpoint.

The client uses the authorization endpoint to obtain authorization from the resource owner via user-agent redirection. This URL is used in all standard OAuth2 flows except the Resource Owner Password Credentials Grant and the Client Credentials Grant.

Source

pub fn set_auth_uri_option( self, auth_url: Option<AuthUrl>, ) -> Client<TE, TR, TIR, RT, TRE, EndpointMaybeSet, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

Conditionally set the authorization endpoint.

The client uses the authorization endpoint to obtain authorization from the resource owner via user-agent redirection. This URL is used in all standard OAuth2 flows except the Resource Owner Password Credentials Grant and the Client Credentials Grant.

Source

pub fn set_client_secret(self, client_secret: ClientSecret) -> Self

Set the client secret.

A client secret is generally used for confidential (i.e., server-side) OAuth2 clients and omitted from public (browser or native app) OAuth2 clients (see RFC 8252).

Source

pub fn set_device_authorization_url( self, device_authorization_url: DeviceAuthorizationUrl, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, EndpointSet, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

Set the RFC 8628 device authorization endpoint used for the Device Authorization Flow.

See exchange_device_code().

Source

pub fn set_device_authorization_url_option( self, device_authorization_url: Option<DeviceAuthorizationUrl>, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, EndpointMaybeSet, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

Conditionally set the RFC 8628 device authorization endpoint used for the Device Authorization Flow.

See exchange_device_code().

Source

pub fn set_introspection_url( self, introspection_url: IntrospectionUrl, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, EndpointSet, HasRevocationUrl, HasTokenUrl>

Set the RFC 7662 introspection endpoint.

See introspect().

Source

pub fn set_introspection_url_option( self, introspection_url: Option<IntrospectionUrl>, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, EndpointMaybeSet, HasRevocationUrl, HasTokenUrl>

Conditionally set the RFC 7662 introspection endpoint.

See introspect().

Source

pub fn set_redirect_uri(self, redirect_url: RedirectUrl) -> Self

Set the redirect URL used by the authorization endpoint.

Source

pub fn set_revocation_url( self, revocation_url: RevocationUrl, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, EndpointSet, HasTokenUrl>

Set the RFC 7009 revocation endpoint.

See revoke_token().

Source

pub fn set_revocation_url_option( self, revocation_url: Option<RevocationUrl>, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, EndpointMaybeSet, HasTokenUrl>

Conditionally set the RFC 7009 revocation endpoint.

See revoke_token().

Source

pub fn set_token_uri( self, token_url: TokenUrl, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, EndpointSet>

Set the token endpoint.

The client uses the token endpoint to exchange an authorization code for an access token, typically with client authentication. This URL is used in all standard OAuth2 flows except the Implicit Grant.

Source

pub fn set_token_uri_option( self, token_url: Option<TokenUrl>, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, EndpointMaybeSet>

Conditionally set the token endpoint.

The client uses the token endpoint to exchange an authorization code for an access token, typically with client authentication. This URL is used in all standard OAuth2 flows except the Implicit Grant.

Source

pub fn client_id(&self) -> &ClientId

Return the Client ID.

Source

pub fn auth_type(&self) -> &AuthType

Return the type of client authentication used for communicating with the authorization server.

Source

pub fn redirect_uri(&self) -> Option<&RedirectUrl>

Return the redirect URL used by the authorization endpoint.

Source§

impl<TE, TR, TIR, RT, TRE, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, EndpointSet, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods requiring an authorization endpoint.

Source

pub fn auth_uri(&self) -> &AuthUrl

Return the authorization endpoint.

Source

pub fn authorize_url<S>(&self, state_fn: S) -> AuthorizationRequest<'_>
where S: FnOnce() -> CsrfToken,

Generate an authorization URL for a new authorization request.

Requires set_auth_uri() to have been previously called to set the authorization endpoint.

§Arguments
  • state_fn - A function that returns an opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client.
§Security Warning

Callers should use a fresh, unpredictable state for each authorization request and verify that this value matches the state parameter passed by the authorization server to the redirect URI. Doing so mitigates Cross-Site Request Forgery attacks. To disable CSRF protections (NOT recommended), use insecure::authorize_url instead.

Source§

impl<TE, TR, TIR, RT, TRE, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, EndpointMaybeSet, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods with a possibly-set authorization endpoint.

Source

pub fn auth_uri(&self) -> Option<&AuthUrl>

Return the authorization endpoint.

Source

pub fn authorize_url<S>( &self, state_fn: S, ) -> Result<AuthorizationRequest<'_>, ConfigurationError>
where S: FnOnce() -> CsrfToken,

Generate an authorization URL for a new authorization request.

Requires set_auth_uri_option() to have been previously called to set the authorization endpoint.

§Arguments
  • state_fn - A function that returns an opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client.
§Security Warning

Callers should use a fresh, unpredictable state for each authorization request and verify that this value matches the state parameter passed by the authorization server to the redirect URI. Doing so mitigates Cross-Site Request Forgery attacks. To disable CSRF protections (NOT recommended), use insecure::authorize_url instead.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, EndpointSet>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState,

Methods requiring a token endpoint.

Source

pub fn exchange_client_credentials( &self, ) -> ClientCredentialsTokenRequest<'_, TE, TR>

Request an access token using the Client Credentials Flow.

Requires set_token_uri() to have been previously called to set the token endpoint.

Source

pub fn exchange_code( &self, code: AuthorizationCode, ) -> CodeTokenRequest<'_, TE, TR>

Exchange a code returned during the Authorization Code Flow for an access token.

Acquires ownership of the code because authorization codes may only be used once to retrieve an access token from the authorization server.

Requires set_token_uri() to have been previously called to set the token endpoint.

Source

pub fn exchange_device_access_token<'a, EF>( &'a self, auth_response: &'a DeviceAuthorizationResponse<EF>, ) -> DeviceAccessTokenRequest<'a, 'static, TR, EF>

Exchange an RFC 8628 Device Authorization Response returned by exchange_device_code() for an access token.

Requires set_token_uri() to have been previously called to set the token endpoint.

Source

pub fn exchange_password<'a>( &'a self, username: &'a ResourceOwnerUsername, password: &'a ResourceOwnerPassword, ) -> PasswordTokenRequest<'a, TE, TR>

Request an access token using the Resource Owner Password Credentials Flow.

Requires set_token_uri() to have been previously called to set the token endpoint.

Source

pub fn exchange_refresh_token<'a>( &'a self, refresh_token: &'a RefreshToken, ) -> RefreshTokenRequest<'a, TE, TR>

Exchange a refresh token for an access token.

See https://tools.ietf.org/html/rfc6749#section-6.

Requires set_token_uri() to have been previously called to set the token endpoint.

Source

pub fn token_uri(&self) -> &TokenUrl

Return the token endpoint.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, EndpointMaybeSet>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState,

Methods with a possibly-set token endpoint.

Source

pub fn exchange_client_credentials( &self, ) -> Result<ClientCredentialsTokenRequest<'_, TE, TR>, ConfigurationError>

Request an access token using the Client Credentials Flow.

Requires set_token_uri_option() to have been previously called to set the token endpoint.

Source

pub fn exchange_code( &self, code: AuthorizationCode, ) -> Result<CodeTokenRequest<'_, TE, TR>, ConfigurationError>

Exchange a code returned during the Authorization Code Flow for an access token.

Acquires ownership of the code because authorization codes may only be used once to retrieve an access token from the authorization server.

Requires set_token_uri_option() to have been previously called to set the token endpoint.

Source

pub fn exchange_device_access_token<'a, EF>( &'a self, auth_response: &'a DeviceAuthorizationResponse<EF>, ) -> Result<DeviceAccessTokenRequest<'a, 'static, TR, EF>, ConfigurationError>

Exchange an RFC 8628 Device Authorization Response returned by exchange_device_code() for an access token.

Requires set_token_uri_option() to have been previously called to set the token endpoint.

Source

pub fn exchange_password<'a>( &'a self, username: &'a ResourceOwnerUsername, password: &'a ResourceOwnerPassword, ) -> Result<PasswordTokenRequest<'a, TE, TR>, ConfigurationError>

Request an access token using the Resource Owner Password Credentials Flow.

Requires set_token_uri_option() to have been previously called to set the token endpoint.

Source

pub fn exchange_refresh_token<'a>( &'a self, refresh_token: &'a RefreshToken, ) -> Result<RefreshTokenRequest<'a, TE, TR>, ConfigurationError>

Exchange a refresh token for an access token.

See https://tools.ietf.org/html/rfc6749#section-6.

Requires set_token_uri_option() to have been previously called to set the token endpoint.

Source

pub fn token_uri(&self) -> Option<&TokenUrl>

Return the token endpoint.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, EndpointSet, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods requiring a device authorization endpoint.

Source

pub fn exchange_device_code(&self) -> DeviceAuthorizationRequest<'_, TE>

Begin the RFC 8628 Device Authorization Flow and retrieve a Device Authorization Response.

Requires set_device_authorization_url() to have been previously called to set the device authorization endpoint.

See exchange_device_access_token().

Source

pub fn device_authorization_url(&self) -> &DeviceAuthorizationUrl

Return the RFC 8628 device authorization endpoint used for the Device Authorization Flow.

See exchange_device_code().

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, EndpointMaybeSet, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods with a possibly-set device authorization endpoint.

Source

pub fn exchange_device_code( &self, ) -> Result<DeviceAuthorizationRequest<'_, TE>, ConfigurationError>

Begin the RFC 8628 Device Authorization Flow.

Requires set_device_authorization_url_option() to have been previously called to set the device authorization endpoint.

See exchange_device_access_token().

Source

pub fn device_authorization_url(&self) -> Option<&DeviceAuthorizationUrl>

Return the RFC 8628 device authorization endpoint used for the Device Authorization Flow.

See exchange_device_code().

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, EndpointSet, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods requiring an introspection endpoint.

Source

pub fn introspect<'a>( &'a self, token: &'a AccessToken, ) -> IntrospectionRequest<'a, TE, TIR>

Retrieve metadata for an access token using the RFC 7662 introspection endpoint.

Requires set_introspection_url() to have been previously called to set the introspection endpoint.

Source

pub fn introspection_url(&self) -> &IntrospectionUrl

Return the RFC 7662 introspection endpoint.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasRevocationUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, EndpointMaybeSet, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasRevocationUrl: EndpointState, HasTokenUrl: EndpointState,

Methods with a possibly-set introspection endpoint.

Source

pub fn introspect<'a>( &'a self, token: &'a AccessToken, ) -> Result<IntrospectionRequest<'a, TE, TIR>, ConfigurationError>

Retrieve metadata for an access token using the RFC 7662 introspection endpoint.

Requires set_introspection_url_option() to have been previously called to set the introspection endpoint.

Source

pub fn introspection_url(&self) -> Option<&IntrospectionUrl>

Return the RFC 7662 introspection endpoint.

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, EndpointSet, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasTokenUrl: EndpointState,

Methods requiring a revocation endpoint.

Source

pub fn revoke_token( &self, token: RT, ) -> Result<RevocationRequest<'_, RT, TRE>, ConfigurationError>

Revoke an access or refresh token using the RFC 7009 revocation endpoint.

Requires set_revocation_url() to have been previously called to set the revocation endpoint.

Source

pub fn revocation_url(&self) -> &RevocationUrl

Return the RFC 7009 revocation endpoint.

See revoke_token().

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasTokenUrl> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, EndpointMaybeSet, HasTokenUrl>
where TE: ErrorResponse + 'static, TR: TokenResponse, TIR: TokenIntrospectionResponse, RT: RevocableToken, TRE: ErrorResponse + 'static, HasAuthUrl: EndpointState, HasDeviceAuthUrl: EndpointState, HasIntrospectionUrl: EndpointState, HasTokenUrl: EndpointState,

Methods with a possible-set revocation endpoint.

Source

pub fn revoke_token( &self, token: RT, ) -> Result<RevocationRequest<'_, RT, TRE>, ConfigurationError>

Revoke an access or refresh token using the RFC 7009 revocation endpoint.

Requires set_revocation_url_option() to have been previously called to set the revocation endpoint.

Source

pub fn revocation_url(&self) -> Option<&RevocationUrl>

Return the RFC 7009 revocation endpoint.

See revoke_token().

Trait Implementations§

Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Clone for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + Clone, TR: TokenResponse + Clone, TIR: TokenIntrospectionResponse + Clone, RT: RevocableToken + Clone, TRE: ErrorResponse + Clone, HasAuthUrl: EndpointState + Clone, HasDeviceAuthUrl: EndpointState + Clone, HasIntrospectionUrl: EndpointState + Clone, HasRevocationUrl: EndpointState + Clone, HasTokenUrl: EndpointState + Clone,

Source§

fn clone( &self, ) -> Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Debug for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: ErrorResponse + Debug, TR: TokenResponse + Debug, TIR: TokenIntrospectionResponse + Debug, RT: RevocableToken + Debug, TRE: ErrorResponse + Debug, HasAuthUrl: EndpointState + Debug, HasDeviceAuthUrl: EndpointState + Debug, HasIntrospectionUrl: EndpointState + Debug, HasRevocationUrl: EndpointState + Debug, HasTokenUrl: EndpointState + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Freeze for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> RefUnwindSafe for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: RefUnwindSafe, TR: RefUnwindSafe, TIR: RefUnwindSafe, RT: RefUnwindSafe, TRE: RefUnwindSafe, HasAuthUrl: RefUnwindSafe, HasDeviceAuthUrl: RefUnwindSafe, HasIntrospectionUrl: RefUnwindSafe, HasRevocationUrl: RefUnwindSafe, HasTokenUrl: RefUnwindSafe,

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Send for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: Send, TR: Send, TIR: Send, RT: Send, TRE: Send, HasAuthUrl: Send, HasDeviceAuthUrl: Send, HasIntrospectionUrl: Send, HasRevocationUrl: Send, HasTokenUrl: Send,

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Sync for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: Sync, TR: Sync, TIR: Sync, RT: Sync, TRE: Sync, HasAuthUrl: Sync, HasDeviceAuthUrl: Sync, HasIntrospectionUrl: Sync, HasRevocationUrl: Sync, HasTokenUrl: Sync,

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> Unpin for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: Unpin, TR: Unpin, TIR: Unpin, RT: Unpin, TRE: Unpin, HasAuthUrl: Unpin, HasDeviceAuthUrl: Unpin, HasIntrospectionUrl: Unpin, HasRevocationUrl: Unpin, HasTokenUrl: Unpin,

§

impl<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl> UnwindSafe for Client<TE, TR, TIR, RT, TRE, HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl>
where TE: UnwindSafe, TR: UnwindSafe, TIR: UnwindSafe, RT: UnwindSafe, TRE: UnwindSafe, HasAuthUrl: UnwindSafe, HasDeviceAuthUrl: UnwindSafe, HasIntrospectionUrl: UnwindSafe, HasRevocationUrl: UnwindSafe, HasTokenUrl: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T