pub struct InMemoryTokenCache { /* private fields */ }Expand description
In-memory token cache with TTL support.
Provides thread-safe caching for both JWT and installation tokens with automatic expiration handling.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryTokenCache
impl Default for InMemoryTokenCache
Source§impl TokenCache for InMemoryTokenCache
impl TokenCache for InMemoryTokenCache
Source§fn get_jwt<'life0, 'async_trait>(
&'life0 self,
app_id: GitHubAppId,
) -> Pin<Box<dyn Future<Output = Result<Option<JsonWebToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_jwt<'life0, 'async_trait>(
&'life0 self,
app_id: GitHubAppId,
) -> Pin<Box<dyn Future<Output = Result<Option<JsonWebToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cached JWT token.
Source§fn store_jwt<'life0, 'async_trait>(
&'life0 self,
jwt: JsonWebToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_jwt<'life0, 'async_trait>(
&'life0 self,
jwt: JsonWebToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store JWT token in cache.
Source§fn get_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstallationToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstallationToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cached installation token.
Source§fn store_installation_token<'life0, 'async_trait>(
&'life0 self,
token: InstallationToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_installation_token<'life0, 'async_trait>(
&'life0 self,
token: InstallationToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store installation token in cache.
Source§fn invalidate_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invalidate_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invalidate installation token.
Source§fn cleanup_expired_tokens(&self)
fn cleanup_expired_tokens(&self)
Cleanup expired tokens.
Auto Trait Implementations§
impl Freeze for InMemoryTokenCache
impl RefUnwindSafe for InMemoryTokenCache
impl Send for InMemoryTokenCache
impl Sync for InMemoryTokenCache
impl Unpin for InMemoryTokenCache
impl UnsafeUnpin for InMemoryTokenCache
impl UnwindSafe for InMemoryTokenCache
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