pub struct OAuthClientBuilder { /* private fields */ }Expand description
Builder for OAuth clients.
Implementations§
Source§impl OAuthClientBuilder
impl OAuthClientBuilder
Sourcepub fn secret(self, credential: impl Into<String>) -> OAuthClientBuilder
pub fn secret(self, credential: impl Into<String>) -> OAuthClientBuilder
Sets the client secret (makes this a confidential client).
Sourcepub fn redirect_uri(self, uri: impl Into<String>) -> OAuthClientBuilder
pub fn redirect_uri(self, uri: impl Into<String>) -> OAuthClientBuilder
Adds a redirect URI.
Sourcepub fn redirect_uris<I, S>(self, uris: I) -> OAuthClientBuilder
pub fn redirect_uris<I, S>(self, uris: I) -> OAuthClientBuilder
Adds multiple redirect URIs.
Sourcepub fn scope(self, scope: impl Into<String>) -> OAuthClientBuilder
pub fn scope(self, scope: impl Into<String>) -> OAuthClientBuilder
Adds an allowed scope.
Sourcepub fn scopes<I, S>(self, scopes: I) -> OAuthClientBuilder
pub fn scopes<I, S>(self, scopes: I) -> OAuthClientBuilder
Adds multiple allowed scopes.
Sourcepub fn name(self, name: impl Into<String>) -> OAuthClientBuilder
pub fn name(self, name: impl Into<String>) -> OAuthClientBuilder
Sets the client name.
Sourcepub fn description(self, description: impl Into<String>) -> OAuthClientBuilder
pub fn description(self, description: impl Into<String>) -> OAuthClientBuilder
Sets the client description.
Sourcepub fn build(self) -> Result<OAuthClient, OAuthError>
pub fn build(self) -> Result<OAuthClient, OAuthError>
Builds the OAuth client.
§Errors
Returns an error if:
- No redirect URIs are configured
- Client ID is empty
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OAuthClientBuilder
impl RefUnwindSafe for OAuthClientBuilder
impl Send for OAuthClientBuilder
impl Sync for OAuthClientBuilder
impl Unpin for OAuthClientBuilder
impl UnwindSafe for OAuthClientBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).