[][src]Struct http::uri::Scheme

pub struct Scheme { /* fields omitted */ }

Represents the scheme component of a URI

Implementations

impl Scheme[src]

pub const HTTP: Scheme[src]

HTTP protocol scheme

pub const HTTPS: Scheme[src]

HTTP protocol over TLS.

pub 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");

Trait Implementations

impl AsRef<str> for Scheme[src]

impl Clone for Scheme[src]

impl Debug for Scheme[src]

impl Display for Scheme[src]

impl Eq for Scheme[src]

impl FromStr for Scheme[src]

type Err = InvalidUri

The associated error which can be returned from parsing.

impl Hash for Scheme[src]

Case-insensitive hashing

impl PartialEq<Scheme> for Scheme[src]

impl PartialEq<Scheme> for str[src]

Case-insensitive equality

impl PartialEq<str> for Scheme[src]

Case-insensitive equality

Examples

let scheme: Scheme = "HTTP".parse().unwrap();
assert_eq!(scheme, *"http");

impl<'a> TryFrom<&'a [u8]> for Scheme[src]

type Error = InvalidUri

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a str> for Scheme[src]

type Error = InvalidUri

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Scheme[src]

impl Send for Scheme[src]

impl Sync for Scheme[src]

impl Unpin for Scheme[src]

impl UnwindSafe for Scheme[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.