Lines Matching full:scheme
11 /// Represents the scheme component of a URI
13 pub struct Scheme { struct
30 impl Scheme { impl
31 /// HTTP protocol scheme
32 pub const HTTP: Scheme = Scheme {
37 pub const HTTPS: Scheme = Scheme {
42 Scheme { in empty()
47 /// Return a str representation of the scheme
53 /// let scheme: Scheme = "http".parse().unwrap();
54 /// assert_eq!(scheme.as_str(), "http");
70 impl<'a> TryFrom<&'a [u8]> for Scheme { implementation
92 impl<'a> TryFrom<&'a str> for Scheme { implementation
100 impl FromStr for Scheme { implementation
108 impl fmt::Debug for Scheme { implementation
114 impl fmt::Display for Scheme { implementation
120 impl AsRef<str> for Scheme { implementation
127 impl PartialEq for Scheme { implementation
128 fn eq(&self, other: &Scheme) -> bool { in eq()
142 impl Eq for Scheme {} implementation
149 /// # use http::uri::Scheme;
150 /// let scheme: Scheme = "HTTP".parse().unwrap();
151 /// assert_eq!(scheme, *"http");
153 impl PartialEq<str> for Scheme { implementation
160 impl PartialEq<Scheme> for str {
161 fn eq(&self, other: &Scheme) -> bool { in eq()
167 impl Hash for Scheme { implementation
195 // Require the scheme to not be too long in order to enable further
199 // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
201 // SCHEME_CHARS is a table of valid characters in the scheme part of a URI. An
295 // Not a scheme in parse()
304 // Return scheme in parse()
307 // Invald scheme character, abort in parse()
334 impl From<Scheme2> for Scheme { implementation
336 Scheme { inner: src } in from()
346 assert_eq!(&scheme("http"), "http"); in scheme_eq_to_str()
347 assert_eq!(&scheme("https"), "https"); in scheme_eq_to_str()
348 assert_eq!(&scheme("ftp"), "ftp"); in scheme_eq_to_str()
349 assert_eq!(&scheme("my+funky+scheme"), "my+funky+scheme"); in scheme_eq_to_str()
354 Scheme::try_from("my_funky_scheme").expect_err("Unexpectly valid Scheme"); in invalid_scheme_is_error()
357 Scheme::try_from([0xC0].as_ref()).expect_err("Unexpectly valid Scheme"); in invalid_scheme_is_error()
360 fn scheme(s: &str) -> Scheme { in scheme() argument
361 s.parse().expect(&format!("Invalid scheme: {}", s)) in scheme()