pub struct AccessToken { /* private fields */ }Expand description
A live access token for one connection. It is wiped on drop and its
Debug prints nothing, so a token cannot reach a log or a panic message
by accident. Its value is only reachable through AccessToken::expose,
which is the one place a caller has to mean it.
Implementations§
Source§impl AccessToken
impl AccessToken
Sourcepub fn connection_id(&self) -> &str
pub fn connection_id(&self) -> &str
The connection this token belongs to.
Sourcepub fn expose(&self) -> &str
pub fn expose(&self) -> &str
The bearer token itself. Deliberately not Deref: taking it should be
a call a reader can see.
Sourcepub fn into_secret(self) -> Zeroizing<String>
pub fn into_secret(self) -> Zeroizing<String>
Takes the token out, to hand to an
HttpClient header and drop.
Sourcepub fn expires_at(&self) -> Option<&str>
pub fn expires_at(&self) -> Option<&str>
When the token lapses, RFC 3339 UTC.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccessToken
impl RefUnwindSafe for AccessToken
impl Send for AccessToken
impl Sync for AccessToken
impl Unpin for AccessToken
impl UnsafeUnpin for AccessToken
impl UnwindSafe for AccessToken
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