pub struct Uncased<'s> { /* private fields */ }
Expand description
An uncased (case-preserving), owned or borrowed ASCII string.
Implementations§
§impl<'s> Uncased<'s>
impl<'s> Uncased<'s>
pub fn new<S>(string: S) -> Uncased<'s>
pub fn new<S>(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");
pub 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());
pub 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§
§impl<'a> AsRef<UncasedStr> for Uncased<'a>
impl<'a> AsRef<UncasedStr> for Uncased<'a>
§fn as_ref(&self) -> &UncasedStr
fn as_ref(&self) -> &UncasedStr
Converts this type into a shared reference of the (usually inferred) input type.
§impl<'a> Borrow<UncasedStr> for Uncased<'a>
impl<'a> Borrow<UncasedStr> for Uncased<'a>
§fn borrow(&self) -> &UncasedStr
fn borrow(&self) -> &UncasedStr
Immutably borrows from an owned value. Read more
§impl<'a> Deref for Uncased<'a>
impl<'a> Deref for Uncased<'a>
§type Target = UncasedStr
type Target = UncasedStr
The resulting type after dereferencing.
§fn deref(&self) -> &UncasedStr
fn deref(&self) -> &UncasedStr
Dereferences the value.
§impl<'a> Ord for Uncased<'a>
impl<'a> Ord for Uncased<'a>
§impl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>
impl<'a, 'b> PartialOrd<Uncased<'b>> for Uncased<'a>
impl<'s> Eq for Uncased<'s>
Auto Trait Implementations§
impl<'s> Freeze for Uncased<'s>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.