Skip to main content

Prr

Trait Prr 

Source
pub trait Prr<Body>: Debug {
Show 14 methods // Required methods fn headers(&self) -> Vec<(String, HeaderValue)>; fn set_header_value(&mut self, header: &str, value: &str) -> Result<()>; fn clear_headers(&mut self) -> Result<()>; fn remove_header(&mut self, header: &str) -> Result<()>; fn add_header(&mut self, header: &str, value: &str) -> Result<()>; fn url(&self) -> Result<Url>; fn set_url(&mut self, url: &Url) -> Result<()>; fn set_status(&mut self, response: &u16) -> Result<()>; fn get_status(&self) -> Result<StatusCode>; fn set_body(&mut self, body: &Body) -> Result<()>; fn get_body(&self) -> Result<&Body>; fn set_method(&mut self, method: &Method) -> Result<()>; fn get_method(&self) -> Method; fn tpe(&self) -> PrrType;
}
Expand description

A request or response that can be manipulated during processing of metadata.

Required Methods§

Source

fn headers(&self) -> Vec<(String, HeaderValue)>

Source

fn set_header_value(&mut self, header: &str, value: &str) -> Result<()>

Source

fn clear_headers(&mut self) -> Result<()>

Source

fn remove_header(&mut self, header: &str) -> Result<()>

Source

fn add_header(&mut self, header: &str, value: &str) -> Result<()>

Source

fn url(&self) -> Result<Url>

Source

fn set_url(&mut self, url: &Url) -> Result<()>

Source

fn set_status(&mut self, response: &u16) -> Result<()>

Source

fn get_status(&self) -> Result<StatusCode>

Source

fn set_body(&mut self, body: &Body) -> Result<()>

Source

fn get_body(&self) -> Result<&Body>

Source

fn set_method(&mut self, method: &Method) -> Result<()>

Source

fn get_method(&self) -> Method

Source

fn tpe(&self) -> PrrType

Get the type of processable request/response.

Trait Implementations§

Source§

impl<A> From<&dyn Prr<A>> for Scope<TypedValue>

Create a scope that contains the values of the MEL core variables present in an HTTP request.

Source§

fn from(value: &dyn Prr<A>) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<&dyn Prr<Vec<u8>>> for Request

Source§

type Error = Error

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

fn try_from(value: &dyn Prr<Vec<u8>>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&dyn Prr<Vec<u8>>> for Request<Vec<u8>>

Source§

type Error = Error

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

fn try_from(value: &dyn Prr<Vec<u8>>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&dyn Prr<Vec<u8>>> for Response<Vec<u8>>

Source§

type Error = Error

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

fn try_from(value: &dyn Prr<Vec<u8>>) -> Result<Self, Self::Error>

Performs the conversion.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§