Enum tk_http::server::RequestTarget [] [src]

pub enum RequestTarget<'a> {
    Origin(&'a str),
    Absolute {
        scheme: &'a str,
        authority: &'a str,
        path: &'a str,
    },
    Authority(&'a str),
    Asterisk,
}

A middle part of the request line

Most people get used to having path there or maybe asterisk. But in the real protocol there are all four options.

You don't have to implement all of them though. Using Head::path() provides good shortcut for handling Origin and Absolute in uniform way and Authority is useful only for (non-reverse, ) proxies.

Variants

Usual form of /hello?name=world

Full url: http://example.com:8080/hello

Note in this case (unlike in Origin) path may not start with a slash

Fields of Absolute

Scheme, might be http or https (latter is useless for now)

Authority is basically host[:port]

Path relative to root, it's not normalized, so might be empty

Only hostname example.com:8080, only useful for CONNECT method

Asterisk *

Trait Implementations

impl<'a> Debug for RequestTarget<'a>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for RequestTarget<'a>

impl<'a> Sync for RequestTarget<'a>