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 on_foreign_function(&mut self, _function_id: u32, _arguments_size: usize)
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 UnsafeUnpin 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