pub struct RootContextAdapter { /* private fields */ }Expand description
Adapter to enrich the root context with policy metadata.
Implementations§
Source§impl RootContextAdapter
impl RootContextAdapter
pub fn new(context: Box<dyn RootContext>) -> Self
pub fn boxed(self) -> Box<dyn RootContext>
Trait Implementations§
Source§impl Context for RootContextAdapter
impl Context for RootContextAdapter
fn on_http_call_response( &mut self, token_id: u32, num_headers: usize, body_size: usize, num_trailers: usize, )
fn on_grpc_call_response( &mut self, token_id: u32, status_code: u32, response_size: usize, )
fn on_done(&mut self) -> bool
fn get_current_time(&self) -> SystemTime
fn get_property(&self, _path: Vec<&str>) -> Option<Vec<u8>>
fn set_property(&self, _path: Vec<&str>, _value: Option<&[u8]>)
fn dispatch_http_call( &self, _upstream: &str, _headers: Vec<(&str, &str)>, _body: Option<&[u8]>, _trailers: Vec<(&str, &str)>, _timeout: Duration, ) -> Result<u32, Status>
fn get_http_call_response_headers(&self) -> Vec<(String, String)>
fn get_http_call_response_headers_bytes(&self) -> Vec<(String, Vec<u8>)>
fn get_http_call_response_header(&self, _name: &str) -> Option<String>
fn get_http_call_response_header_bytes(&self, _name: &str) -> Option<Vec<u8>>
fn get_http_call_response_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>
fn get_http_call_response_trailers(&self) -> Vec<(String, String)>
fn get_http_call_response_trailers_bytes(&self) -> Vec<(String, Vec<u8>)>
fn get_http_call_response_trailer(&self, _name: &str) -> Option<String>
fn get_http_call_response_trailer_bytes(&self, _name: &str) -> Option<Vec<u8>>
fn dispatch_grpc_call( &self, _upstream_name: &str, _service_name: &str, _method_name: &str, _initial_metadata: Vec<(&str, &[u8])>, _message: Option<&[u8]>, _timeout: Duration, ) -> Result<u32, Status>
fn get_grpc_call_response_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>
fn cancel_grpc_call(&self, _token_id: u32)
fn open_grpc_stream( &self, _cluster_name: &str, _service_name: &str, _method_name: &str, _initial_metadata: Vec<(&str, &[u8])>, ) -> Result<u32, Status>
fn on_grpc_stream_initial_metadata( &mut self, _token_id: u32, _num_elements: u32, )
fn get_grpc_stream_initial_metadata(&self) -> Vec<(String, Vec<u8>)>
fn get_grpc_stream_initial_metadata_value(&self, _name: &str) -> Option<Vec<u8>>
fn send_grpc_stream_message( &self, _token_id: u32, _message: Option<&[u8]>, _end_stream: bool, )
fn on_grpc_stream_message(&mut self, _token_id: u32, _message_size: usize)
fn get_grpc_stream_message( &mut self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>
fn on_grpc_stream_trailing_metadata( &mut self, _token_id: u32, _num_elements: u32, )
fn get_grpc_stream_trailing_metadata(&self) -> Vec<(String, Vec<u8>)>
fn get_grpc_stream_trailing_metadata_value( &self, _name: &str, ) -> Option<Vec<u8>>
fn cancel_grpc_stream(&self, _token_id: u32)
fn close_grpc_stream(&self, _token_id: u32)
fn on_grpc_stream_close(&mut self, _token_id: u32, _status_code: u32)
fn get_grpc_status(&self) -> (u32, Option<String>)
fn call_foreign_function( &self, _function_name: &str, _arguments: Option<&[u8]>, ) -> Result<Option<Vec<u8>>, Status>
fn done(&self)
Source§impl RootContext for RootContextAdapter
impl RootContext for RootContextAdapter
fn on_configure(&mut self, plugin_configuration_size: usize) -> bool
fn create_http_context(&self, context_id: u32) -> Option<Box<dyn HttpContext>>
fn get_type(&self) -> Option<ContextType>
fn on_tick(&mut self)
fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool
fn get_vm_configuration(&self) -> Option<Vec<u8>>
fn get_plugin_configuration(&self) -> Option<Vec<u8>>
fn set_tick_period(&self, _period: Duration)
fn on_queue_ready(&mut self, _queue_id: u32)
fn on_log(&mut self)
fn create_stream_context( &self, _context_id: u32, ) -> Option<Box<dyn StreamContext>>
Auto Trait Implementations§
impl Freeze for RootContextAdapter
impl !RefUnwindSafe for RootContextAdapter
impl !Send for RootContextAdapter
impl !Sync for RootContextAdapter
impl Unpin for RootContextAdapter
impl !UnwindSafe for RootContextAdapter
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