pub struct Factory;Expand description
Factory for creating TokenStore instances from a StoreConfig.
§Examples
use actix_jwt::store::factory::{Factory, StoreConfig};
let factory = Factory::new();
let store = factory.create_store(&StoreConfig::default()).await.unwrap();
assert_eq!(store.count().await.unwrap(), 0);Implementations§
Source§impl Factory
impl Factory
Sourcepub async fn create_store(
&self,
config: &StoreConfig,
) -> Result<Box<dyn TokenStore>, JwtError>
pub async fn create_store( &self, config: &StoreConfig, ) -> Result<Box<dyn TokenStore>, JwtError>
Creates a TokenStore based on the provided configuration.
§Errors
JwtError::Internal- whenStoreType::Redisis requested but theredis-storefeature is not enabled, or when the Redis connection fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Factory
impl RefUnwindSafe for Factory
impl Send for Factory
impl Sync for Factory
impl Unpin for Factory
impl UnsafeUnpin for Factory
impl UnwindSafe for Factory
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