pub struct PluginResources {
pub metrics: Option<Arc<GatewayMetrics>>,
pub outbound: Arc<OutboundClient>,
pub consumers: ArcSwap<ConsumerStore>,
pub counters: CounterStoreRegistry,
pub traffic: TrafficRegistries,
}Expand description
Handle to process-wide services, injected into plugins at construction.
Grows as shared infrastructure lands (counter backends); every field must
be cheap to clone or shared behind its own Arc.
Fields§
§metrics: Option<Arc<GatewayMetrics>>Shared Prometheus registry; None disables recording (unit tests).
outbound: Arc<OutboundClient>Pooled outbound HTTP client for upstream proxying and plugin callouts.
consumers: ArcSwap<ConsumerStore>Consumer store, swapped atomically on config reload so lookups on the
request path are lock-free. Plugins should load() per request, not
cache the inner Arc across requests.
counters: CounterStoreRegistryRate-limit counter backends, resolved by policy name at config load.
traffic: TrafficRegistriesShared state for traffic-control node pairs (concurrency, breakers, cache).
Implementations§
Source§impl PluginResources
impl PluginResources
Sourcepub fn new(metrics: Option<Arc<GatewayMetrics>>) -> Arc<Self> ⓘ
pub fn new(metrics: Option<Arc<GatewayMetrics>>) -> Arc<Self> ⓘ
Creates the process-wide resources handle with an empty consumer
store; callers swap in the real store via PluginResources::consumers.
Auto Trait Implementations§
impl !Freeze for PluginResources
impl !RefUnwindSafe for PluginResources
impl Send for PluginResources
impl Sync for PluginResources
impl Unpin for PluginResources
impl UnsafeUnpin for PluginResources
impl !UnwindSafe for PluginResources
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