pub struct AuthTokenResponseBuilder { /* private fields */ }Expand description
Builder for AuthTokenResponse.
Implementations§
Source§impl AuthTokenResponseBuilder
impl AuthTokenResponseBuilder
Sourcepub fn access_token(self, access_token: impl Into<String>) -> Self
pub fn access_token(self, access_token: impl Into<String>) -> Self
Sets the access token.
Sourcepub fn refresh_token(self, refresh_token: impl Into<String>) -> Self
pub fn refresh_token(self, refresh_token: impl Into<String>) -> Self
Sets the refresh token.
Sourcepub fn token_type(self, token_type: impl Into<String>) -> Self
pub fn token_type(self, token_type: impl Into<String>) -> Self
Sets the token type (typically "Bearer").
Sourcepub const fn expires_in(self, expires_in: u64) -> Self
pub const fn expires_in(self, expires_in: u64) -> Self
Sets the number of seconds until the access token expires.
Sourcepub fn provider(self, provider: impl Into<String>) -> Self
pub fn provider(self, provider: impl Into<String>) -> Self
Sets the provider that authenticated the user.
Sourcepub fn build(self) -> Result<AuthTokenResponse, String>
pub fn build(self) -> Result<AuthTokenResponse, String>
Builds the AuthTokenResponse.
§Errors
Returns an error string if any required field (access_token, token_type,
expires_in, or provider) was not set.
Trait Implementations§
Source§impl Debug for AuthTokenResponseBuilder
impl Debug for AuthTokenResponseBuilder
Source§impl Default for AuthTokenResponseBuilder
impl Default for AuthTokenResponseBuilder
Source§fn default() -> AuthTokenResponseBuilder
fn default() -> AuthTokenResponseBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthTokenResponseBuilder
impl RefUnwindSafe for AuthTokenResponseBuilder
impl Send for AuthTokenResponseBuilder
impl Sync for AuthTokenResponseBuilder
impl Unpin for AuthTokenResponseBuilder
impl UnsafeUnpin for AuthTokenResponseBuilder
impl UnwindSafe for AuthTokenResponseBuilder
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more