pub struct PluginContext<'a> {
pub response: &'a Value,
pub headers: Option<&'a HashMap<String, String>>,
pub trailers: Option<&'a HashMap<String, String>>,
pub timing: Option<&'a AssertionTiming>,
pub protocol: Option<&'a str>,
}Expand description
Context passed to plugins during assertion evaluation.
Fields§
§response: &'a Value§headers: Option<&'a HashMap<String, String>>§trailers: Option<&'a HashMap<String, String>>§timing: Option<&'a AssertionTiming>§protocol: Option<&'a str>Wire protocol that produced this response — "grpc", "grpc-web", or
"connectrpc" (the same canonical strings OPTIONS.protocol:
accepts). None when the caller didn’t have protocol information to
give (e.g. a standalone/test evaluation with no real call behind it).
Implementations§
Source§impl<'a> PluginContext<'a>
impl<'a> PluginContext<'a>
pub fn new(response: &'a Value) -> Self
pub fn with_headers(self, headers: Option<&'a HashMap<String, String>>) -> Self
pub fn with_trailers( self, trailers: Option<&'a HashMap<String, String>>, ) -> Self
pub fn with_timing(self, timing: Option<&'a AssertionTiming>) -> Self
pub fn with_protocol(self, protocol: Option<&'a str>) -> Self
Trait Implementations§
Source§impl<'a> Clone for PluginContext<'a>
impl<'a> Clone for PluginContext<'a>
Source§fn clone(&self) -> PluginContext<'a>
fn clone(&self) -> PluginContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for PluginContext<'a>
impl<'a> RefUnwindSafe for PluginContext<'a>
impl<'a> Send for PluginContext<'a>
impl<'a> Sync for PluginContext<'a>
impl<'a> Unpin for PluginContext<'a>
impl<'a> UnsafeUnpin for PluginContext<'a>
impl<'a> UnwindSafe for PluginContext<'a>
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