pub trait ValidBuilder {
// Required methods
fn new() -> Self;
fn build(&self) -> Result<Request, BuilderError>;
fn host(&mut self, host: String) -> &mut Self;
fn port(&mut self, port: u16) -> &mut Self;
fn http_version(&mut self, http_version: String) -> &mut Self;
fn method(&mut self, method: String) -> &mut Self;
fn path(&mut self, path: String) -> &mut Self;
fn header(&mut self, key: String, value: String) -> &mut Self;
fn body(&mut self, body: String) -> &mut Self;
fn uri(&mut self, uri: String) -> &mut Self;
}
Expand description
Describes the request builder
Required Methods§
Sourcefn host(&mut self, host: String) -> &mut Self
fn host(&mut self, host: String) -> &mut Self
Set the host of the request (example: httpbin.org)
Sourcefn http_version(&mut self, http_version: String) -> &mut Self
fn http_version(&mut self, http_version: String) -> &mut Self
Set the HTTP version of the request (example: 1.1)
Sourcefn header(&mut self, key: String, value: String) -> &mut Self
fn header(&mut self, key: String, value: String) -> &mut Self
Set a header of the request (example: Content-Type, application/json)
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.