pub struct SessionCredentials {
pub websocket_url: String,
pub websocket_token: CommunicationToken,
pub profile: Option<WireProfile>,
pub issued: Timestamp,
}Expand description
A grant with the clock attached: what a driver actually needs to connect.
Fields§
§websocket_url: StringWhere to connect.
websocket_token: CommunicationTokenWhat to put in Authorization: Bearer ….
profile: Option<WireProfile>The S2 JSON message version both sides settled on.
issued: TimestampWhen it was issued.
Implementations§
Source§impl SessionCredentials
impl SessionCredentials
Sourcepub fn is_expired(&self, now: Timestamp) -> bool
pub fn is_expired(&self, now: Timestamp) -> bool
Whether the thirty seconds have run out.
Worth asking before dialling rather than after: a driver that queues a connection behind a slow DNS lookup can easily arrive too late, and the failure a server returns for an expired token looks exactly like the one it returns for a wrong one.
Trait Implementations§
Source§impl Clone for SessionCredentials
impl Clone for SessionCredentials
Auto Trait Implementations§
impl Forget for SessionCredentials
impl Freeze for SessionCredentials
impl Move for SessionCredentials
impl RefUnwindSafe for SessionCredentials
impl Send for SessionCredentials
impl Sync for SessionCredentials
impl Unpin for SessionCredentials
impl UnsafeUnpin for SessionCredentials
impl UnwindSafe for SessionCredentials
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