[][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]

pub fn new<S>(string: S) -> Uncased<'s> where
    S: Into<Cow<'s, str>>, 
[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");

pub fn into_string(self) -> String[src]

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>[src]

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[src]

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, 'b> PartialEq<Uncased<'b>> for Uncased<'a>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

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

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

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

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

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

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

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

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

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

type Target = UncasedStr

The resulting type after dereferencing.

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

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

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

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

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

Auto Trait Implementations

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

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

Blanket Implementations

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

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> IntoCollection for T[src]

impl<T, I> AsResult for T where
    I: Input
[src]

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