pub struct StoreRegistry {
clients: HashMap<String, Arc<RedisStoreClient>>,
counters: HashMap<String, Arc<dyn CounterStore>>,
sessions: HashMap<String, Arc<dyn SessionStore>>,
}Expand description
One client per named store, plus the counter backend built on it.
Read-only after construction; replaced wholesale via the ArcSwap in
PluginResources when config changes.
Fields§
§clients: HashMap<String, Arc<RedisStoreClient>>§counters: HashMap<String, Arc<dyn CounterStore>>§sessions: HashMap<String, Arc<dyn SessionStore>>Implementations§
Source§impl StoreRegistry
impl StoreRegistry
Sourcepub fn rebuild(
prev: &StoreRegistry,
stores: &[StoreConfig],
metrics: Option<Arc<GatewayMetrics>>,
) -> Result<StoreRegistry, String>
pub fn rebuild( prev: &StoreRegistry, stores: &[StoreConfig], metrics: Option<Arc<GatewayMetrics>>, ) -> Result<StoreRegistry, String>
Builds a registry for stores, reusing prev’s client wherever a
store’s resolved config fingerprint is unchanged, so unrelated config
reloads keep established connections.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
True when name has a live client in this registry. Used by tests
(and anything else that needs a lookup without a client-typed error)
to assert what a dry-run compile did or did not durably swap in.
Sourcepub fn client(&self, name: &str) -> Result<Arc<RedisStoreClient>, String>
pub fn client(&self, name: &str) -> Result<Arc<RedisStoreClient>, String>
The raw client for name (ACME storage borrows it; sessions/counters have
their own typed accessors).
Sourcepub fn counter_store(&self, name: &str) -> Result<Arc<dyn CounterStore>, String>
pub fn counter_store(&self, name: &str) -> Result<Arc<dyn CounterStore>, String>
Resolves the counter backend for a named store; the error carries the declared-store list so a typo is self-explanatory.
Sourcepub fn session_store(&self, name: &str) -> Result<Arc<dyn SessionStore>, String>
pub fn session_store(&self, name: &str) -> Result<Arc<dyn SessionStore>, String>
Resolves the session backend for a named store; the error carries the declared-store list so a typo is self-explanatory.
Trait Implementations§
Source§impl Default for StoreRegistry
impl Default for StoreRegistry
Source§fn default() -> StoreRegistry
fn default() -> StoreRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for StoreRegistry
impl !UnwindSafe for StoreRegistry
impl Freeze for StoreRegistry
impl Send for StoreRegistry
impl Sync for StoreRegistry
impl Unpin for StoreRegistry
impl UnsafeUnpin for StoreRegistry
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more