Trait ValidRequest

Source
pub trait ValidRequest {
    // Required methods
    fn new(
        method: String,
        path: String,
        headers: HashMap<String, String>,
        body: String,
        host: String,
        port: u16,
        http_version: String,
    ) -> Self;
    fn send(&self) -> Result<Response, RequestError>;
}
Expand description

Describes a valid request

Required Methods§

Source

fn new( method: String, path: String, headers: HashMap<String, String>, body: String, host: String, port: u16, http_version: String, ) -> Self

Create a new request

Source

fn send(&self) -> Result<Response, RequestError>

Send the request synchronously

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ValidRequest for Request

Implement the ValidRequest trait for the Request type