Struct http::uri::Scheme
[−]
[src]
pub struct Scheme { /* fields omitted */ }
Represents the scheme component of a URI
Methods
impl Scheme
[src]
[src]
Attempt to convert a Scheme
from Bytes
This function will be replaced by a TryFrom
implementation once the
trait lands in stable.
Examples
extern crate bytes; use bytes::Bytes; let bytes = Bytes::from("http"); let scheme = Scheme::from_shared(bytes).unwrap(); assert_eq!(scheme.as_str(), "http");
fn as_str(&self) -> &str
[src]
Return a str representation of the scheme
Examples
let scheme: Scheme = "http".parse().unwrap(); assert_eq!(scheme.as_str(), "http");
fn into_bytes(self) -> Bytes
[src]
Converts this Scheme
back to a sequence of bytes
Trait Implementations
impl Clone for Scheme
[src]
fn clone(&self) -> Scheme
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl FromStr for Scheme
[src]
type Err = InvalidUri
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl Debug for Scheme
[src]
impl Display for Scheme
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more