pub struct WasmAgent { /* private fields */ }Expand description
WebAssembly agent
Implementations§
Source§impl WasmAgent
impl WasmAgent
Sourcepub fn new<P: AsRef<Path>>(
module_path: P,
pool_size: usize,
fail_open: bool,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( module_path: P, pool_size: usize, fail_open: bool, ) -> Result<Self>
Create a new Wasm agent from a module file
Sourcepub fn from_bytes(
module_bytes: &[u8],
pool_size: usize,
fail_open: bool,
) -> Result<Self>
pub fn from_bytes( module_bytes: &[u8], pool_size: usize, fail_open: bool, ) -> Result<Self>
Create a new Wasm agent from module bytes
Sourcepub fn build_response(result: WasmResult) -> AgentResponse
pub fn build_response(result: WasmResult) -> AgentResponse
Build AgentResponse from WasmResult
Trait Implementations§
Source§impl AgentHandler for WasmAgent
impl AgentHandler for WasmAgent
Source§fn on_configure<'life0, 'async_trait>(
&'life0 self,
event: ConfigureEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_configure<'life0, 'async_trait>(
&'life0 self,
event: ConfigureEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a configure event Read more
Source§fn on_request_headers<'life0, 'async_trait>(
&'life0 self,
event: RequestHeadersEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_request_headers<'life0, 'async_trait>(
&'life0 self,
event: RequestHeadersEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request headers event
Source§fn on_response_headers<'life0, 'async_trait>(
&'life0 self,
event: ResponseHeadersEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_response_headers<'life0, 'async_trait>(
&'life0 self,
event: ResponseHeadersEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a response headers event
Source§fn on_request_body_chunk<'life0, 'async_trait>(
&'life0 self,
_event: RequestBodyChunkEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_request_body_chunk<'life0, 'async_trait>(
&'life0 self,
_event: RequestBodyChunkEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle a request body chunk event
Source§fn on_response_body_chunk<'life0, 'async_trait>(
&'life0 self,
_event: ResponseBodyChunkEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_response_body_chunk<'life0, 'async_trait>(
&'life0 self,
_event: ResponseBodyChunkEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle a response body chunk event
Source§fn on_request_complete<'life0, 'async_trait>(
&'life0 self,
_event: RequestCompleteEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_request_complete<'life0, 'async_trait>(
&'life0 self,
_event: RequestCompleteEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle a request complete event
Source§fn on_websocket_frame<'life0, 'async_trait>(
&'life0 self,
_event: WebSocketFrameEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_websocket_frame<'life0, 'async_trait>(
&'life0 self,
_event: WebSocketFrameEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle a WebSocket frame event Read more
Source§fn on_guardrail_inspect<'life0, 'async_trait>(
&'life0 self,
_event: GuardrailInspectEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_guardrail_inspect<'life0, 'async_trait>(
&'life0 self,
_event: GuardrailInspectEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle a guardrail inspection event Read more
impl Send for WasmAgent
impl Sync for WasmAgent
Auto Trait Implementations§
impl Freeze for WasmAgent
impl !RefUnwindSafe for WasmAgent
impl Unpin for WasmAgent
impl !UnwindSafe for WasmAgent
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request