pub struct TokenRecordBuilder { /* private fields */ }Expand description
Builder for TokenRecord.
Implementations§
Source§impl TokenRecordBuilder
impl TokenRecordBuilder
Sourcepub fn issued_at(self, instant: OffsetDateTime) -> Self
pub fn issued_at(self, instant: OffsetDateTime) -> Self
Sets the issued-at instant.
Sourcepub fn issued_now(self) -> Self
pub fn issued_now(self) -> Self
Convenience helper that stamps issued_at with the current clock.
Sourcepub fn expires_at(self, instant: OffsetDateTime) -> Self
pub fn expires_at(self, instant: OffsetDateTime) -> Self
Sets an absolute expiry instant.
Sourcepub fn expires_in(self, duration: Duration) -> Self
pub fn expires_in(self, duration: Duration) -> Self
Sets a relative expiry duration from the issued instant.
Sourcepub fn access_token(self, token: impl Into<String>) -> Self
pub fn access_token(self, token: impl Into<String>) -> Self
Provides the access token value.
Sourcepub fn refresh_token(self, token: impl Into<String>) -> Self
pub fn refresh_token(self, token: impl Into<String>) -> Self
Provides the refresh token value.
Sourcepub fn build(self) -> Result<TokenRecord, TokenRecordBuilderError>
pub fn build(self) -> Result<TokenRecord, TokenRecordBuilderError>
Consumes the builder and produces a TokenRecord.
Trait Implementations§
Source§impl Clone for TokenRecordBuilder
impl Clone for TokenRecordBuilder
Source§fn clone(&self) -> TokenRecordBuilder
fn clone(&self) -> TokenRecordBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for TokenRecordBuilder
impl RefUnwindSafe for TokenRecordBuilder
impl Send for TokenRecordBuilder
impl Sync for TokenRecordBuilder
impl Unpin for TokenRecordBuilder
impl UnwindSafe for TokenRecordBuilder
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