[−][src]Struct hyper_router::Route
Holds route information
Fields
method: Method
HTTP method to match
path: Path
Path to match
handler: Handler
Request handler
This should be method that accepts Hyper's Request and Response:
ⓘThis example is not tested
use hyper::server::{Request, Response}; use hyper::header::{ContentLength, ContentType}; fn hello_handler(_: Request) -> Response { let body = "Hello World"; Response::new() .with_header(ContentLength(body.len() as u64)) .with_header(ContentType::plaintext()) .with_body(body) }
Methods
impl Route
[src]
pub fn options(path: &str) -> RouteBuilder
[src]
pub fn get(path: &str) -> RouteBuilder
[src]
pub fn post(path: &str) -> RouteBuilder
[src]
pub fn put(path: &str) -> RouteBuilder
[src]
pub fn delete(path: &str) -> RouteBuilder
[src]
pub fn head(path: &str) -> RouteBuilder
[src]
pub fn trace(path: &str) -> RouteBuilder
[src]
pub fn connect(path: &str) -> RouteBuilder
[src]
pub fn patch(path: &str) -> RouteBuilder
[src]
pub fn from(method: Method, path: &str) -> RouteBuilder
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,