Struct rocket_http::uncased::Uncased[][src]

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

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

Implementations

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

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

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> AsRef<UncasedStr> for Uncased<'a>[src]

fn as_ref(&self) -> &UncasedStr[src]

Performs the conversion.

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

fn borrow(&self) -> &UncasedStr[src]

Immutably borrows from an owned value. Read more

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

fn clone(&self) -> Uncased<'s>[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

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

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

Formats the value using the given formatter. Read more

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

type Target = UncasedStr

The resulting type after dereferencing.

fn deref(&self) -> &UncasedStr[src]

Dereferences the value.

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

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

Formats the value using the given formatter. Read more

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

fn from(string: &'c str) -> Self[src]

Performs the conversion.

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

fn from(string: Cow<'c, str>) -> Self[src]

Performs the conversion.

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

fn from(string: String) -> Self[src]

Performs the conversion.

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

default fn from(string: T) -> Self[src]

Performs the conversion.

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

fn hash<H: Hasher>(&self, hasher: &mut H)[src]

Feeds this value into the given Hasher. Read more

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 cmp(&self, other: &Self) -> Ordering[src]

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

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

Compares and returns the maximum of two values. Read more

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

Compares and returns the minimum of two values. Read more

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

Restrict a value to a certain interval. Read more

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

fn eq(&self, other: &&'b str) -> bool[src]

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

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

This method tests for !=.

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

fn eq(&self, other: &Uncased<'b>) -> bool[src]

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

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

This method tests for !=.

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

fn eq(&self, other: &Uncased<'b>) -> bool[src]

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

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

fn eq(&self, other: &Uncased<'b>) -> bool[src]

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

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

This method tests for !=.

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

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

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

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

This method tests for !=.

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

fn partial_cmp(&self, other: &Uncased<'b>) -> Option<Ordering>[src]

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

#[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> Eq for Uncased<'s>[src]

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn as_result(self) -> Result<T, ParseErr<I>>[src]

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

pub fn into_collection<A>(Self) -> SmallVec<A> where
    A: Array<Item = T>, 
[src]

Converts self into a collection.

pub fn mapped<U, F, A>(Self, F) -> SmallVec<A> where
    A: Array<Item = U>,
    F: FnMut(T) -> U, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 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> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.