Lines Matching refs:Method

45 pub struct Method(Inner);  struct
114 impl Method { implementation
116 pub const GET: Method = Method(Get);
119 pub const POST: Method = Method(Post);
122 pub const PUT: Method = Method(Put);
125 pub const DELETE: Method = Method(Delete);
128 pub const HEAD: Method = Method(Head);
131 pub const OPTIONS: Method = Method(Options);
134 pub const CONNECT: Method = Method(Connect);
137 pub const PATCH: Method = Method(Patch);
140 pub const TRACE: Method = Method(Trace);
143 pub fn from_bytes(src: &[u8]) -> Result<Method, InvalidMethod> { in from_bytes() argument
150 b"GET" => Ok(Method(Get)), in from_bytes()
151 b"PUT" => Ok(Method(Put)), in from_bytes()
152 _ => Method::extension_inline(src), in from_bytes()
157 b"POST" => Ok(Method(Post)), in from_bytes()
158 b"HEAD" => Ok(Method(Head)), in from_bytes()
159 _ => Method::extension_inline(src), in from_bytes()
164 b"PATCH" => Ok(Method(Patch)), in from_bytes()
165 b"TRACE" => Ok(Method(Trace)), in from_bytes()
166 _ => Method::extension_inline(src), in from_bytes()
171 b"DELETE" => Ok(Method(Delete)), in from_bytes()
172 _ => Method::extension_inline(src), in from_bytes()
177 b"OPTIONS" => Ok(Method(Options)), in from_bytes()
178 b"CONNECT" => Ok(Method(Connect)), in from_bytes()
179 _ => Method::extension_inline(src), in from_bytes()
184 Method::extension_inline(src) in from_bytes()
190 Ok(Method(ExtensionAllocated(data.into_boxed_slice()))) in from_bytes()
196 fn extension_inline(src: &[u8]) -> Result<Method, InvalidMethod> { in extension_inline() argument
201 Ok(Method(ExtensionInline(data, src.len() as u8))) in extension_inline()
269 impl AsRef<str> for Method { implementation
276 impl<'a> PartialEq<&'a Method> for Method { implementation
278 fn eq(&self, other: & &'a Method) -> bool { in eq()
283 impl<'a> PartialEq<Method> for &'a Method { implementation
285 fn eq(&self, other: &Method) -> bool { in eq()
290 impl PartialEq<str> for Method { implementation
297 impl PartialEq<Method> for str {
299 fn eq(&self, other: &Method) -> bool { in eq()
304 impl<'a> PartialEq<&'a str> for Method { implementation
311 impl<'a> PartialEq<Method> for &'a str {
313 fn eq(&self, other: &Method) -> bool { in eq()
318 impl fmt::Debug for Method { implementation
324 impl fmt::Display for Method { implementation
330 impl Default for Method { implementation
332 fn default() -> Method { in default()
333 Method::GET in default()
337 impl<'a> From<&'a Method> for Method { implementation
339 fn from(t: &'a Method) -> Self { in from()
344 impl<'a> HttpTryFrom<&'a Method> for Method { implementation
348 fn try_from(t: &'a Method) -> Result<Self, Self::Error> { in try_from()
353 impl<'a> HttpTryFrom<&'a [u8]> for Method { implementation
358 Method::from_bytes(t) in try_from()
362 impl<'a> HttpTryFrom<&'a str> for Method { implementation
371 impl FromStr for Method { implementation
410 assert_eq!(Method::GET, Method::GET); in test_method_eq()
411 assert_eq!(Method::GET, "GET"); in test_method_eq()
412 assert_eq!(&Method::GET, "GET"); in test_method_eq()
414 assert_eq!("GET", Method::GET); in test_method_eq()
415 assert_eq!("GET", &Method::GET); in test_method_eq()
417 assert_eq!(&Method::GET, Method::GET); in test_method_eq()
418 assert_eq!(Method::GET, &Method::GET); in test_method_eq()
423 assert!(Method::from_str("").is_err()); in test_invalid_method()
424 assert!(Method::from_bytes(b"").is_err()); in test_invalid_method()
429 assert!(Method::OPTIONS.is_idempotent()); in test_is_idempotent()
430 assert!(Method::GET.is_idempotent()); in test_is_idempotent()
431 assert!(Method::PUT.is_idempotent()); in test_is_idempotent()
432 assert!(Method::DELETE.is_idempotent()); in test_is_idempotent()
433 assert!(Method::HEAD.is_idempotent()); in test_is_idempotent()
434 assert!(Method::TRACE.is_idempotent()); in test_is_idempotent()
436 assert!(!Method::POST.is_idempotent()); in test_is_idempotent()
437 assert!(!Method::CONNECT.is_idempotent()); in test_is_idempotent()
438 assert!(!Method::PATCH.is_idempotent()); in test_is_idempotent()