pub struct ApiKeys(pub Arc<dyn ApiKeyStore>);Expand description
The DI handle for an ApiKeyStore. Apps register the store with
app.provide(ApiKeys::new(store)); the ApiKey extractor resolves this
concrete type. A newtype (rather than a bare Arc<dyn ApiKeyStore>) is the
documented contract — see the module docs.
Tuple Fields§
§0: Arc<dyn ApiKeyStore>Implementations§
Source§impl ApiKeys
impl ApiKeys
pub fn new(store: impl ApiKeyStore + 'static) -> Self
Sourcepub fn from_arc(store: Arc<dyn ApiKeyStore>) -> Self
pub fn from_arc(store: Arc<dyn ApiKeyStore>) -> Self
Wrap an already-Arc’d store (e.g. one shared with other components).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ApiKeys
impl !UnwindSafe for ApiKeys
impl Freeze for ApiKeys
impl Send for ApiKeys
impl Sync for ApiKeys
impl Unpin for ApiKeys
impl UnsafeUnpin for ApiKeys
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