Struct Scheme

pub struct Scheme { /* private fields */ }

Represents the scheme component of a URI

Implementations

impl Scheme

const HTTP: Scheme = _;

HTTP protocol scheme

const HTTPS: Scheme = _;

HTTP protocol over TLS.

fn as_str(&self) -> &str

Return a str representation of the scheme

Examples

# use http::uri::*;
let scheme: Scheme = "http".parse().unwrap();
assert_eq!(scheme.as_str(), "http");

Trait Implementations

impl AsRef<str> for Scheme

fn as_ref(&self) -> &str

impl Clone for Scheme

fn clone(&self) -> Self

impl Debug for Scheme

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for Scheme

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for Scheme

impl FromStr for Scheme

type Err = InvalidUri;
fn from_str(s: &str) -> Result<Self, Self::Err>

impl Hash for Scheme

fn hash<H>(&self, state: &mut H)
where
    H: Hasher,

impl PartialEq for Scheme

fn eq(&self, other: &Scheme) -> bool

impl PartialEq<str> for Scheme

fn eq(&self, other: &str) -> bool

impl TryFrom<&[u8]> for Scheme

type Error = InvalidUri;
fn try_from(s: &[u8]) -> Result<Self, Self::Error>

impl TryFrom<&str> for Scheme

type Error = InvalidUri;
fn try_from(s: &str) -> Result<Self, Self::Error>

Auto Trait Implementations

impl Freeze for Scheme

impl RefUnwindSafe for Scheme

impl Send for Scheme

impl Sync for Scheme

impl Unpin for Scheme

impl UnsafeUnpin for Scheme

impl UnwindSafe for Scheme

Blanket Implementations

impl<T> Any for Scheme where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Scheme where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Scheme where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Scheme where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Scheme

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Scheme where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for Scheme where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for Scheme where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Scheme where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Scheme where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>