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

[src]

Return a str representation of the scheme

Examples

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

[src]

Converts this Scheme back to a sequence of bytes

Trait Implementations

impl Clone for Scheme
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl FromStr for Scheme
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Debug for Scheme
[src]

[src]

Formats the value using the given formatter.

impl Display for Scheme
[src]

[src]

Formats the value using the given formatter. Read more

impl From<Scheme2> for Scheme
[src]

[src]

Performs the conversion.