[−][src]Struct rocket::http::uncased::UncasedStr
A reference to an uncased (case-preserving) ASCII string. This is typically
created from an &str
as follows:
use rocket::http::uncased::UncasedStr; let ascii_ref: &UncasedStr = "Hello, world!".into();
Methods
impl UncasedStr
[src]
pub fn new(string: &str) -> &UncasedStr
[src]
Returns a reference to an UncasedStr
from an &str
.
Example
use rocket::http::uncased::UncasedStr; let uncased_str = UncasedStr::new("Hello!"); assert_eq!(uncased_str, "hello!"); assert_eq!(uncased_str, "Hello!"); assert_eq!(uncased_str, "HeLLo!");
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!");
pub fn into_uncased(self: Box<UncasedStr>) -> Uncased<'static>
[src]
Converts a Box<UncasedStr>
into an Uncased
without copying or allocating.
Example
use rocket::http::uncased::Uncased; let uncased = Uncased::new("Hello!"); let boxed = uncased.clone().into_boxed_uncased(); assert_eq!(boxed.into_uncased(), uncased);
Trait Implementations
impl<'a> AsRef<UncasedStr> for Uncased<'a>
[src]
fn as_ref(&self) -> &UncasedStr
[src]
impl<'a> Borrow<UncasedStr> for Uncased<'a>
[src]
fn borrow(&self) -> &UncasedStr
[src]
impl Debug for UncasedStr
[src]
impl Display for UncasedStr
[src]
impl Eq for UncasedStr
[src]
impl<'a> From<&'a str> for &'a UncasedStr
[src]
fn from(string: &'a str) -> &'a UncasedStr
[src]
impl Hash for UncasedStr
[src]
fn hash<H>(&self, hasher: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for UncasedStr
[src]
fn cmp(&self, other: &UncasedStr) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a> PartialEq<&'a str> for UncasedStr
[src]
impl PartialEq<UncasedStr> for str
[src]
impl<'a> PartialEq<UncasedStr> for &'a str
[src]
impl PartialEq<UncasedStr> for UncasedStr
[src]
impl PartialEq<str> for UncasedStr
[src]
impl PartialOrd<UncasedStr> for UncasedStr
[src]
Auto Trait Implementations
impl RefUnwindSafe for UncasedStr
impl Send for UncasedStr
impl Sync for UncasedStr
impl Unpin for UncasedStr
impl UnwindSafe for UncasedStr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,