pub enum CacheableResource<T> {
NotModified,
New {
entity_tag: EntityTag,
data: T,
},
}Expand description
Represents a resource that can be cached, along with its EntityTag.
This enum is used to provide cacheable data to the consumers of the credential provider. It allows a data provider to return either new data (with an EntityTag) or indicate that the caller’s cached version (identified by a previously provided EntityTag) is still valid.
Variants§
NotModified
Indicates that the resource has not been modified and the cached version is still valid.
New
Contains the new resource data and its associated EntityTag.
Trait Implementations§
Source§impl<T: Clone> Clone for CacheableResource<T>
impl<T: Clone> Clone for CacheableResource<T>
Source§fn clone(&self) -> CacheableResource<T>
fn clone(&self) -> CacheableResource<T>
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 moreSource§impl<T: Debug> Debug for CacheableResource<T>
impl<T: Debug> Debug for CacheableResource<T>
Source§impl From<CacheableResource<Token>> for Result<AccessToken, CredentialsError>
impl From<CacheableResource<Token>> for Result<AccessToken, CredentialsError>
Source§fn from(token: CacheableResource<Token>) -> Self
fn from(token: CacheableResource<Token>) -> Self
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for CacheableResource<T>
impl<T: PartialEq> PartialEq for CacheableResource<T>
impl<T> StructuralPartialEq for CacheableResource<T>
Auto Trait Implementations§
impl<T> Freeze for CacheableResource<T>where
T: Freeze,
impl<T> RefUnwindSafe for CacheableResource<T>where
T: RefUnwindSafe,
impl<T> Send for CacheableResource<T>where
T: Send,
impl<T> Sync for CacheableResource<T>where
T: Sync,
impl<T> Unpin for CacheableResource<T>where
T: Unpin,
impl<T> UnsafeUnpin for CacheableResource<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CacheableResource<T>where
T: UnwindSafe,
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