Struct rocket_http::uncased::Uncased
source · [−]pub struct Uncased<'s> { /* private fields */ }
Expand description
An uncased (case-preserving), owned or borrowed ASCII string.
Implementations
sourceimpl<'s> Uncased<'s>
impl<'s> Uncased<'s>
sourcepub fn new<S: Into<Cow<'s, str>>>(string: S) -> Uncased<'s>
pub fn new<S: Into<Cow<'s, str>>>(string: S) -> Uncased<'s>
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");
sourcepub fn into_string(self) -> String
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());
sourcepub fn into_boxed_uncased(self) -> Box<UncasedStr>
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>
Trait Implementations
sourceimpl<'a> AsRef<UncasedStr> for Uncased<'a>
impl<'a> AsRef<UncasedStr> for Uncased<'a>
sourcefn as_ref(&self) -> &UncasedStr
fn as_ref(&self) -> &UncasedStr
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<'a> Borrow<UncasedStr> for Uncased<'a>
impl<'a> Borrow<UncasedStr> for Uncased<'a>
sourcefn borrow(&self) -> &UncasedStr
fn borrow(&self) -> &UncasedStr
Immutably borrows from an owned value. Read more
sourceimpl<'a> Deref for Uncased<'a>
impl<'a> Deref for Uncased<'a>
type Target = UncasedStr
type Target = UncasedStr
The resulting type after dereferencing.
sourcefn deref(&self) -> &UncasedStr
fn deref(&self) -> &UncasedStr
Dereferences the value.
sourceimpl<'a> Ord for Uncased<'a>
impl<'a> Ord for Uncased<'a>
sourceimpl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>
impl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>
sourcefn partial_cmp(&self, other: &Uncased<'b>) -> Option<Ordering>
fn partial_cmp(&self, other: &Uncased<'b>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'s> Eq for Uncased<'s>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more