Struct unleash_edge::types::TokenRefresh
source · pub struct TokenRefresh {
pub token: EdgeToken,
pub etag: Option<EntityTag>,
pub next_refresh: Option<DateTime<Utc>>,
pub last_refreshed: Option<DateTime<Utc>>,
pub last_check: Option<DateTime<Utc>>,
pub failure_count: u32,
}
Fields§
§token: EdgeToken
§etag: Option<EntityTag>
§next_refresh: Option<DateTime<Utc>>
§last_refreshed: Option<DateTime<Utc>>
§last_check: Option<DateTime<Utc>>
§failure_count: u32
Implementations§
source§impl TokenRefresh
impl TokenRefresh
pub fn new(token: EdgeToken, etag: Option<EntityTag>) -> Self
sourcepub fn backoff(&self, refresh_interval: &Duration) -> Self
pub fn backoff(&self, refresh_interval: &Duration) -> Self
Something went wrong (but it was retriable. Increment our failure count and set last_checked and next_refresh
sourcepub fn successful_check(&self, refresh_interval: &Duration) -> Self
pub fn successful_check(&self, refresh_interval: &Duration) -> Self
We successfully talked to upstream, but there was no updates. Update our next_refresh, decrement our failure count and set when we last_checked
sourcepub fn successful_refresh(
&self,
refresh_interval: &Duration,
etag: Option<EntityTag>
) -> Self
pub fn successful_refresh( &self, refresh_interval: &Duration, etag: Option<EntityTag> ) -> Self
We successfully talked to upstream. There were updates. Update next_refresh, last_refreshed and last_check, and decrement our failure count
Trait Implementations§
source§impl Clone for TokenRefresh
impl Clone for TokenRefresh
source§fn clone(&self) -> TokenRefresh
fn clone(&self) -> TokenRefresh
Returns a copy 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 moresource§impl Debug for TokenRefresh
impl Debug for TokenRefresh
source§impl<'de> Deserialize<'de> for TokenRefresh
impl<'de> Deserialize<'de> for TokenRefresh
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TokenRefresh
impl RefUnwindSafe for TokenRefresh
impl Send for TokenRefresh
impl Sync for TokenRefresh
impl Unpin for TokenRefresh
impl UnwindSafe for TokenRefresh
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