CgiBuilder

Struct CgiBuilder 

Source
pub struct CgiBuilder { /* private fields */ }
Available on crate feature client only.
Expand description

A builder for CGI-like requests

Implementations§

Source§

impl CgiBuilder

Source

pub fn new() -> CgiBuilder

Creates a new CgiBuilder instance

Source

pub fn var(self, key: String, value: String) -> CgiBuilder

Inserts an environment variable

Source

pub fn var_noreplace(self, key: String, value: String) -> CgiBuilder

Inserts an environment variable if it doesn’t already exist

Source

pub fn auth(self, auth_type: Option<String>, username: String) -> CgiBuilder

Inserts HTTP authentication-related data

Source

pub fn server(self, server_software: String) -> CgiBuilder

Inserts server software information

Source

pub fn server_admin(self, server_admin: String) -> CgiBuilder

Inserts server administrator information

Source

pub fn server_address(self, server_address: SocketAddr) -> CgiBuilder

Inserts server address information

Source

pub fn client_address(self, client_address: SocketAddr) -> CgiBuilder

Inserts client address information

Source

pub fn hostname(self, server_name: String) -> CgiBuilder

Inserts server hostname information

Source

pub fn script_path( self, script_path: PathBuf, wwwroot: PathBuf, path_info: Option<String>, ) -> CgiBuilder

Inserts script path information

Source

pub fn https(self) -> CgiBuilder

Sets the HTTPS environment variable to “on”

Source

pub fn request_uri(self, uri: &Uri) -> CgiBuilder

Sets the REQUEST_URI environment variable

Source

pub fn system(self) -> CgiBuilder

Inserts environment variables from the system

Source

pub fn build<B>(self, request: Request<B>) -> (CgiEnvironment, CgiRequest<B>)
where B: Body, <B as Body>::Data: AsRef<[u8]> + Send + 'static, <B as Body>::Error: Into<Error>,

Builds the CGI request

Trait Implementations§

Source§

impl Default for CgiBuilder

Source§

fn default() -> CgiBuilder

Returns the “default value” for a type. Read more

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<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, 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.