pub struct Request<'a> {
    pub middleware: HashMap<String, String>,
    pub route: Option<Route>,
    /* private fields */
}
Expand description

The struct that contains all the data sent by the browser.

Fields

middleware: HashMap<String, String>route: Option<Route>

Implementations

Creates and returns an instance of the ´Request´ struct with the data sent by the browser.

Returns the http method of the request.

Examples
use kalgan::http::request::Request;

let method: &String = request.get_method();

Returns the uri of the request.

Examples
use kalgan::http::request::Request;

let uri: &String = request.get_uri();

Returns the http protocol of the request.

Examples
use kalgan::http::request::Request;

let protocol: &String = request.get_protocol();

Returns the collection of cookies of the request.

Examples
use std::collections::HashMap;
use kalgan::http::request::Request;
let cookies: &HashMap<String, String> = request.get_cookies();

Returns the host field of the request.

Examples
use kalgan::http::request::Request;

let host: &String = request.get_host();

Returns the user agent of the request.

Examples
use kalgan::http::request::Request;

let user_agent: &String = request.get_user_agent();

Returns the input data collection of the request.

Examples
use std::collections::HashMap;
use kalgan::http::request::Request;

let input: &HashMap<String, String> = request.get_input();

Returns the referer field of the request.

Examples
use std::collections::HashMap;
use kalgan::http::request::Request;

let referer: &String = request.get_referer();

Returns the collection of files attached to the request.

Examples
use std::collections::HashMap;
use kalgan::http::request::Request;
use kalgan::http::request::File;

let files: &HashMap<String, File> = request.get_files();

Returns the raw value of the request.

Examples
use std::collections::HashMap;
use kalgan::http::request::Request;

let raw: &String = request.get_raw();

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.