#![allow(non_upper_case_globals)]
use hyper;
use http_types;
#[derive(Debug, PartialEq, Eq)]
pub struct Method(http_types::Method);
impl Method {
pub const HEAD: Method = Method(http_types::Method::HEAD);
pub const OPTIONS: Method = Method(http_types::Method::OPTIONS);
pub const GET: Method = Method(http_types::Method::GET);
pub const POST: Method = Method(http_types::Method::POST);
pub const PUT: Method = Method(http_types::Method::PUT);
pub const PATCH: Method = Method(http_types::Method::PATCH);
pub const DELETE: Method = Method(http_types::Method::DELETE);
#[deprecated(since = "0.2.0", note = "use `Method::HEAD` instead")]
pub const Head: Method = Method(http_types::Method::HEAD);
#[deprecated(since = "0.2.0", note = "use `Method::OPTIONS` instead")]
pub const Options: Method = Method(http_types::Method::OPTIONS);
#[deprecated(since = "0.2.0", note = "use `Method::GET` instead")]
pub const Get: Method = Method(http_types::Method::GET);
#[deprecated(since = "0.2.0", note = "use `Method::POST` instead")]
pub const Post: Method = Method(http_types::Method::POST);
#[deprecated(since = "0.2.0", note = "use `Method::PUT` instead")]
pub const Put: Method = Method(http_types::Method::PUT);
#[deprecated(since = "0.2.0", note = "use `Method::PATCH` instead")]
pub const Patch: Method = Method(http_types::Method::PATCH);
#[deprecated(since = "0.2.0", note = "use `Method::DELETE` instead")]
pub const Delete: Method = Method(http_types::Method::DELETE);
pub(crate) fn to_hyper_method(&self) -> hyper::Method {
match *self {
Self::OPTIONS => hyper::Method::Options,
Self::HEAD => hyper::Method::Head,
Self::GET => hyper::Method::Get,
Self::POST => hyper::Method::Post,
Self::PUT => hyper::Method::Put,
Self::PATCH => hyper::Method::Patch,
Self::DELETE => hyper::Method::Delete,
_ => unimplemented!()
}
}
}
pub use hyper::header;
pub use hyper::StatusCode;