pub struct Scheme { /* fields omitted */ }
Represents the scheme component of a URI
HTTP: Scheme = Scheme{inner: Scheme2::Standard(Protocol::Http),}
HTTP protocol scheme
HTTPS: Scheme = Scheme{inner: Scheme2::Standard(Protocol::Https),}
HTTP protocol over TLS.
Attempt to convert a Scheme
from Bytes
This function will be replaced by a TryFrom
implementation once the
trait lands in stable.
extern crate bytes;
use bytes::Bytes;
let bytes = Bytes::from("http");
let scheme = Scheme::from_shared(bytes).unwrap();
assert_eq!(scheme.as_str(), "http");
Return a str representation of the scheme
let scheme: Scheme = "http".parse().unwrap();
assert_eq!(scheme.as_str(), "http");
Converts this Scheme
back to a sequence of bytes
Performs copy-assignment from source
. Read more
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
[−]
This method tests for !=
.
Case-insensitive equality
let scheme: Scheme = "HTTP".parse().unwrap();
assert_eq!(scheme, *"http");
This method tests for self
and other
values to be equal, and is used by ==
. Read more
[−]
This method tests for !=
.
Case-insensitive equality
This method tests for self
and other
values to be equal, and is used by ==
. Read more
[−]
This method tests for !=
.
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more