pub trait Context {
Show 41 methods
// Provided methods
fn get_current_time(&self) -> SystemTime { ... }
fn get_property(&self, _path: Vec<&str>) -> Option<Bytes> { ... }
fn set_property(&self, _path: Vec<&str>, _value: Option<&[u8]>) { ... }
fn get_shared_data(&self, _key: &str) -> (Option<Bytes>, Option<u32>) { ... }
fn set_shared_data(
&self,
_key: &str,
_value: Option<&[u8]>,
_cas: Option<u32>,
) -> Result<(), Status> { ... }
fn register_shared_queue(&self, _name: &str) -> u32 { ... }
fn resolve_shared_queue(&self, _vm_id: &str, _name: &str) -> Option<u32> { ... }
fn dequeue_shared_queue(
&self,
_queue_id: u32,
) -> Result<Option<Bytes>, Status> { ... }
fn enqueue_shared_queue(
&self,
_queue_id: u32,
_value: Option<&[u8]>,
) -> Result<(), Status> { ... }
fn dispatch_http_call(
&self,
_upstream: &str,
_headers: Vec<(&str, &str)>,
_body: Option<&[u8]>,
_trailers: Vec<(&str, &str)>,
_timeout: Duration,
) -> Result<u32, Status> { ... }
fn on_http_call_response(
&mut self,
_token_id: u32,
_num_headers: usize,
_body_size: usize,
_num_trailers: usize,
) { ... }
fn get_http_call_response_headers(&self) -> Vec<(String, String)> { ... }
fn get_http_call_response_headers_bytes(&self) -> Vec<(String, Bytes)> { ... }
fn get_http_call_response_header(&self, _name: &str) -> Option<String> { ... }
fn get_http_call_response_header_bytes(&self, _name: &str) -> Option<Bytes> { ... }
fn get_http_call_response_body(
&self,
_start: usize,
_max_size: usize,
) -> Option<Bytes> { ... }
fn get_http_call_response_trailers(&self) -> Vec<(String, String)> { ... }
fn get_http_call_response_trailers_bytes(&self) -> Vec<(String, Bytes)> { ... }
fn get_http_call_response_trailer(&self, _name: &str) -> Option<String> { ... }
fn get_http_call_response_trailer_bytes(&self, _name: &str) -> Option<Bytes> { ... }
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 on_grpc_call_response(
&mut self,
_token_id: u32,
_status_code: u32,
_response_size: usize,
) { ... }
fn get_grpc_call_response_body(
&self,
_start: usize,
_max_size: usize,
) -> Option<Bytes> { ... }
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, Bytes)> { ... }
fn get_grpc_stream_initial_metadata_value(
&self,
_name: &str,
) -> Option<Bytes> { ... }
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<Bytes> { ... }
fn on_grpc_stream_trailing_metadata(
&mut self,
_token_id: u32,
_num_elements: u32,
) { ... }
fn get_grpc_stream_trailing_metadata(&self) -> Vec<(String, Bytes)> { ... }
fn get_grpc_stream_trailing_metadata_value(
&self,
_name: &str,
) -> Option<Bytes> { ... }
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<Bytes>, Status> { ... }
fn on_done(&mut self) -> bool { ... }
fn done(&self) { ... }
}Expand description
Trait for the context.