HttpContextAdapter

Struct HttpContextAdapter 

Source
pub struct HttpContextAdapter { /* private fields */ }

Implementations§

Source§

impl HttpContextAdapter

Source

pub fn new( http_context: Box<dyn HttpContext>, policy_metadata: Rc<PolicyMetadata>, plugin_name_api_id: Rc<String>, ) -> Self

Source

pub fn boxed(self) -> Box<dyn HttpContext>

Trait Implementations§

Source§

impl Context for HttpContextAdapter

Source§

fn on_http_call_response( &mut self, token_id: u32, num_headers: usize, body_size: usize, num_trailers: usize, )

Source§

fn on_grpc_call_response( &mut self, token_id: u32, status_code: u32, response_size: usize, )

Source§

fn on_done(&mut self) -> bool

Source§

fn get_current_time(&self) -> SystemTime

Source§

fn get_property(&self, _path: Vec<&str>) -> Option<Vec<u8>>

Source§

fn set_property(&self, _path: Vec<&str>, _value: Option<&[u8]>)

Source§

fn get_shared_data(&self, _key: &str) -> (Option<Vec<u8>>, Option<u32>)

Source§

fn set_shared_data( &self, _key: &str, _value: Option<&[u8]>, _cas: Option<u32>, ) -> Result<(), Status>

Source§

fn register_shared_queue(&self, _name: &str) -> u32

Source§

fn resolve_shared_queue(&self, _vm_id: &str, _name: &str) -> Option<u32>

Source§

fn dequeue_shared_queue( &self, _queue_id: u32, ) -> Result<Option<Vec<u8>>, Status>

Source§

fn enqueue_shared_queue( &self, _queue_id: u32, _value: Option<&[u8]>, ) -> Result<(), Status>

Source§

fn dispatch_http_call( &self, _upstream: &str, _headers: Vec<(&str, &str)>, _body: Option<&[u8]>, _trailers: Vec<(&str, &str)>, _timeout: Duration, ) -> Result<u32, Status>

Source§

fn get_http_call_response_headers(&self) -> Vec<(String, String)>

Source§

fn get_http_call_response_headers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn get_http_call_response_header(&self, _name: &str) -> Option<String>

Source§

fn get_http_call_response_header_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn get_http_call_response_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>

Source§

fn get_http_call_response_trailers(&self) -> Vec<(String, String)>

Source§

fn get_http_call_response_trailers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn get_http_call_response_trailer(&self, _name: &str) -> Option<String>

Source§

fn get_http_call_response_trailer_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

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>

Source§

fn get_grpc_call_response_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>

Source§

fn cancel_grpc_call(&self, _token_id: u32)

Source§

fn open_grpc_stream( &self, _cluster_name: &str, _service_name: &str, _method_name: &str, _initial_metadata: Vec<(&str, &[u8])>, ) -> Result<u32, Status>

Source§

fn on_grpc_stream_initial_metadata( &mut self, _token_id: u32, _num_elements: u32, )

Source§

fn get_grpc_stream_initial_metadata(&self) -> Vec<(String, Vec<u8>)>

Source§

fn get_grpc_stream_initial_metadata_value(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn send_grpc_stream_message( &self, _token_id: u32, _message: Option<&[u8]>, _end_stream: bool, )

Source§

fn on_grpc_stream_message(&mut self, _token_id: u32, _message_size: usize)

Source§

fn get_grpc_stream_message( &mut self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>

Source§

fn on_grpc_stream_trailing_metadata( &mut self, _token_id: u32, _num_elements: u32, )

Source§

fn get_grpc_stream_trailing_metadata(&self) -> Vec<(String, Vec<u8>)>

Source§

fn get_grpc_stream_trailing_metadata_value( &self, _name: &str, ) -> Option<Vec<u8>>

Source§

fn cancel_grpc_stream(&self, _token_id: u32)

Source§

fn close_grpc_stream(&self, _token_id: u32)

Source§

fn on_grpc_stream_close(&mut self, _token_id: u32, _status_code: u32)

Source§

fn get_grpc_status(&self) -> (u32, Option<String>)

Source§

fn call_foreign_function( &self, _function_name: &str, _arguments: Option<&[u8]>, ) -> Result<Option<Vec<u8>>, Status>

Source§

fn done(&self)

Source§

impl HttpContext for HttpContextAdapter

Source§

fn on_http_request_headers( &mut self, num_headers: usize, end_of_stream: bool, ) -> Action

Source§

fn on_http_request_body( &mut self, body_size: usize, end_of_stream: bool, ) -> Action

Source§

fn on_http_response_body( &mut self, body_size: usize, end_of_stream: bool, ) -> Action

Source§

fn on_http_response_headers( &mut self, num_headers: usize, end_of_stream: bool, ) -> Action

Source§

fn get_http_request_headers(&self) -> Vec<(String, String)>

Source§

fn get_http_request_headers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn set_http_request_headers(&self, _headers: Vec<(&str, &str)>)

Source§

fn set_http_request_headers_bytes(&self, _headers: Vec<(&str, &[u8])>)

Source§

fn get_http_request_header(&self, _name: &str) -> Option<String>

Source§

fn get_http_request_header_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn set_http_request_header(&self, _name: &str, _value: Option<&str>)

Source§

fn set_http_request_header_bytes(&self, _name: &str, _value: Option<&[u8]>)

Source§

fn add_http_request_header(&self, _name: &str, _value: &str)

Source§

fn add_http_request_header_bytes(&self, _name: &str, _value: &[u8])

Source§

fn get_http_request_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>

Source§

fn set_http_request_body(&self, _start: usize, _size: usize, _value: &[u8])

Source§

fn on_http_request_trailers(&mut self, _num_trailers: usize) -> Action

Source§

fn get_http_request_trailers(&self) -> Vec<(String, String)>

Source§

fn get_http_request_trailers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn set_http_request_trailers(&self, _trailers: Vec<(&str, &str)>)

Source§

fn set_http_request_trailers_bytes(&self, _trailers: Vec<(&str, &[u8])>)

Source§

fn get_http_request_trailer(&self, _name: &str) -> Option<String>

Source§

fn get_http_request_trailer_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn set_http_request_trailer(&self, _name: &str, _value: Option<&str>)

Source§

fn set_http_request_trailer_bytes(&self, _name: &str, _value: Option<&[u8]>)

Source§

fn add_http_request_trailer(&self, _name: &str, _value: &str)

Source§

fn add_http_request_trailer_bytes(&self, _name: &str, _value: &[u8])

Source§

fn resume_http_request(&self)

Source§

fn reset_http_request(&self)

Source§

fn get_http_response_headers(&self) -> Vec<(String, String)>

Source§

fn get_http_response_headers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn set_http_response_headers(&self, _headers: Vec<(&str, &str)>)

Source§

fn set_http_response_headers_bytes(&self, _headers: Vec<(&str, &[u8])>)

Source§

fn get_http_response_header(&self, _name: &str) -> Option<String>

Source§

fn get_http_response_header_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn set_http_response_header(&self, _name: &str, _value: Option<&str>)

Source§

fn set_http_response_header_bytes(&self, _name: &str, _value: Option<&[u8]>)

Source§

fn add_http_response_header(&self, _name: &str, _value: &str)

Source§

fn add_http_response_header_bytes(&self, _name: &str, _value: &[u8])

Source§

fn get_http_response_body( &self, _start: usize, _max_size: usize, ) -> Option<Vec<u8>>

Source§

fn set_http_response_body(&self, _start: usize, _size: usize, _value: &[u8])

Source§

fn on_http_response_trailers(&mut self, _num_trailers: usize) -> Action

Source§

fn get_http_response_trailers(&self) -> Vec<(String, String)>

Source§

fn get_http_response_trailers_bytes(&self) -> Vec<(String, Vec<u8>)>

Source§

fn set_http_response_trailers(&self, _trailers: Vec<(&str, &str)>)

Source§

fn set_http_response_trailers_bytes(&self, _trailers: Vec<(&str, &[u8])>)

Source§

fn get_http_response_trailer(&self, _name: &str) -> Option<String>

Source§

fn get_http_response_trailer_bytes(&self, _name: &str) -> Option<Vec<u8>>

Source§

fn set_http_response_trailer(&self, _name: &str, _value: Option<&str>)

Source§

fn set_http_response_trailer_bytes(&self, _name: &str, _value: Option<&[u8]>)

Source§

fn add_http_response_trailer(&self, _name: &str, _value: &str)

Source§

fn add_http_response_trailer_bytes(&self, _name: &str, _value: &[u8])

Source§

fn resume_http_response(&self)

Source§

fn reset_http_response(&self)

Source§

fn send_http_response( &self, _status_code: u32, _headers: Vec<(&str, &str)>, _body: Option<&[u8]>, )

Source§

fn on_log(&mut self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<C, T> Extract<T> for C
where T: FromContext<C>,

Source§

type Error = <T as FromContext<C>>::Error

Source§

fn extract(&self) -> Result<T, <C as Extract<T>>::Error>

Source§

fn extract_always(&self) -> T
where Self: Extract<T, Error = Infallible>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.