[]Struct rocket::http::uncased::Uncased

pub struct Uncased<'s> { /* fields omitted */ }

An uncased (case-preserving), owned or borrowed ASCII string.

Implementations

impl<'s> Uncased<'s>

pub fn new<S>(string: S) -> Uncased<'s> where
    S: Into<Cow<'s, str>>, 

Creates a new Uncased string from string without allocating.

Example

use rocket::http::uncased::Uncased;

let uncased = Uncased::new("Content-Type");
assert_eq!(uncased, "content-type");
assert_eq!(uncased, "CONTENT-Type");

pub fn into_string(self) -> String

Converts self into an owned String, allocating if necessary.

Example

use rocket::http::uncased::Uncased;

let uncased = Uncased::new("Content-Type");
let string = uncased.into_string();
assert_eq!(string, "Content-Type".to_string());

pub fn into_boxed_uncased(self) -> Box<UncasedStr>

Converts self into a Box<UncasedStr>.

Example

use rocket::http::uncased::Uncased;

let boxed = Uncased::new("Content-Type").into_boxed_uncased();
assert_eq!(&*boxed, "content-type");

Methods from Deref<Target = UncasedStr>

pub fn as_str(&self) -> &str

Returns self as an &str.

Example

use rocket::http::uncased::UncasedStr;

let uncased_str = UncasedStr::new("Hello!");
assert_eq!(uncased_str.as_str(), "Hello!");
assert_ne!(uncased_str.as_str(), "hELLo!");

Trait Implementations

impl<'a> AsRef<UncasedStr> for Uncased<'a>

impl<'a> Borrow<UncasedStr> for Uncased<'a>

impl<'s> Clone for Uncased<'s>

impl<'s> Debug for Uncased<'s>

impl<'a> Deref for Uncased<'a>

type Target = UncasedStr

The resulting type after dereferencing.

impl<'s> Display for Uncased<'s>

impl<'s> Eq for Uncased<'s>

impl<'s, 'c> From<&'c str> for Uncased<'s> where
    'c: 's, 

impl<'s, 'c> From<Cow<'c, str>> for Uncased<'s> where
    'c: 's, 

impl From<String> for Uncased<'static>

impl<'s, 'c, T> From<T> for Uncased<'s> where
    'c: 's,
    T: Into<Cow<'c, str>>, 

impl<'s> Hash for Uncased<'s>

impl<'a> Ord for Uncased<'a>

impl<'a, 'b> PartialEq<&'b str> for Uncased<'a>

impl<'b> PartialEq<Uncased<'b>> for str

impl<'a, 'b> PartialEq<Uncased<'b>> for &'a str

impl<'a, 'b> PartialEq<Uncased<'b>> for Uncased<'a>

impl<'a> PartialEq<str> for Uncased<'a>

impl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>

Auto Trait Implementations

impl<'s> RefUnwindSafe for Uncased<'s>

impl<'s> Send for Uncased<'s>

impl<'s> Sync for Uncased<'s>

impl<'s> Unpin for Uncased<'s>

impl<'s> UnwindSafe for Uncased<'s>

Blanket Implementations

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

impl<T, I> AsResult<T, I> for T where
    I: Input, 

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> IntoCollection<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,