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

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

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

Methods

impl<'s> Uncased<'s>
[src]

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

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

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>

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<'s, 'c: 's> From<&'c str> for Uncased<'s>
[src]

Performs the conversion.

impl From<String> for Uncased<'static>
[src]

Performs the conversion.

impl<'s, 'c: 's> From<Cow<'c, str>> for Uncased<'s>
[src]

Performs the conversion.

impl<'s, 'c: 's, T: Into<Cow<'c, str>>> From<T> for Uncased<'s>
[src]

Performs the conversion.

impl<'a> AsRef<UncasedStr> for Uncased<'a>
[src]

Performs the conversion.

impl<'a> Ord for Uncased<'a>
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<'s> Clone for Uncased<'s>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'s> Eq for Uncased<'s>
[src]

impl<'a, 'b> PartialEq<Uncased<'b>> for Uncased<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> PartialEq<str> for Uncased<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'b> PartialEq<Uncased<'b>> for str
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'s> Hash for Uncased<'s>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> Deref for Uncased<'a>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<'s> Display for Uncased<'s>
[src]

Formats the value using the given formatter. Read more

impl<'s> Debug for Uncased<'s>
[src]

Formats the value using the given formatter. Read more

impl<'a> Borrow<UncasedStr> for Uncased<'a>
[src]

Immutably borrows from an owned value. Read more

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Converts the given value to a String. Read more

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

Performs the conversion.

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Mutably borrows from an owned value. Read more

impl<T> Typeable for T where
    T: Any

Get the TypeId of this object.