pub struct PluginInstances { /* private fields */ }Expand description
Per-request plugin state — holds the instances for all plugins on the route. Created at the start of request processing and dropped at the end.
Implementations§
Source§impl PluginInstances
impl PluginInstances
Sourcepub fn empty() -> Self
pub fn empty() -> Self
The empty instance set (DW-157): the adapter for chains with no WASM plugins (native-only routes) — every per-name dispatch passes through unchanged.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Whether an instance exists for name. The dataplane’s
fail-closed gate (DW-157) uses this to verify that instantiation
covered every WASM plugin a route references before the request
proceeds.
Sourcepub fn instance_mut(&mut self, name: &str) -> Option<&mut PluginInstance>
pub fn instance_mut(&mut self, name: &str) -> Option<&mut PluginInstance>
The named plugin’s instance (DW-157). The unified-chain adapter
dispatches per plugin NAME (the chain interleaves native filters
between WASM entries), so it needs mutable access to exactly one
instance at a time. None when no instance exists for name.
Sourcepub fn instance_request_headers(
&self,
name: &str,
) -> Option<Vec<(String, String)>>
pub fn instance_request_headers( &self, name: &str, ) -> Option<Vec<(String, String)>>
The named plugin’s current request header map (DW-167): the callout driver reads the resumed plugin’s phase payload back through the adapter after delivering a callout response.
Sourcepub fn instance_response_headers(
&self,
name: &str,
) -> Option<Vec<(String, String)>>
pub fn instance_response_headers( &self, name: &str, ) -> Option<Vec<(String, String)>>
The named plugin’s current response header map (DW-167; see
PluginInstances::instance_request_headers).
Sourcepub fn instance_request_body(&self, name: &str) -> Option<Vec<u8>>
pub fn instance_request_body(&self, name: &str) -> Option<Vec<u8>>
The named plugin’s current request body (DW-167; see
PluginInstances::instance_request_headers).
Sourcepub fn instance_response_body(&self, name: &str) -> Option<Vec<u8>>
pub fn instance_response_body(&self, name: &str) -> Option<Vec<u8>>
The named plugin’s current response body (DW-167; see
PluginInstances::instance_request_headers).
Sourcepub fn on_request_headers(
&mut self,
headers: Vec<(String, String)>,
) -> (PhaseOutcome, Vec<(String, String)>)
pub fn on_request_headers( &mut self, headers: Vec<(String, String)>, ) -> (PhaseOutcome, Vec<(String, String)>)
Run proxy_on_request_headers on all instances. Returns the
outcome and the (possibly modified) headers.
Sourcepub fn on_request_body(&mut self, body: Vec<u8>) -> (PhaseOutcome, Vec<u8>)
pub fn on_request_body(&mut self, body: Vec<u8>) -> (PhaseOutcome, Vec<u8>)
Run proxy_on_request_body on all instances. Returns the
outcome and the (possibly modified) body.
Sourcepub fn on_response_headers(
&mut self,
headers: Vec<(String, String)>,
) -> (PhaseOutcome, Vec<(String, String)>)
pub fn on_response_headers( &mut self, headers: Vec<(String, String)>, ) -> (PhaseOutcome, Vec<(String, String)>)
Run proxy_on_response_headers on all instances. Returns the
outcome and the (possibly modified) headers.
Sourcepub fn on_response_body(&mut self, body: Vec<u8>) -> (PhaseOutcome, Vec<u8>)
pub fn on_response_body(&mut self, body: Vec<u8>) -> (PhaseOutcome, Vec<u8>)
Run proxy_on_response_body on all instances. Returns the
outcome and the (possibly modified) body.
Auto Trait Implementations§
impl Freeze for PluginInstances
impl !RefUnwindSafe for PluginInstances
impl Send for PluginInstances
impl Sync for PluginInstances
impl Unpin for PluginInstances
impl !UnwindSafe for PluginInstances
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&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