Struct rocket::http::uncased::UncasedStr [−][src]
#[repr(C)]pub struct 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]
impl UncasedStr
pub fn new(string: &str) -> &UncasedStr
[src]
pub fn new(string: &str) -> &UncasedStr
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]
pub fn as_str(&self) -> &str
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]
pub fn into_uncased(self: Box<UncasedStr>) -> Uncased<'static>
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 Debug for UncasedStr
[src]
impl Debug for UncasedStr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for UncasedStr
[src]
impl PartialEq for UncasedStr
fn eq(&self, other: &UncasedStr) -> bool
[src]
fn eq(&self, other: &UncasedStr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<str> for UncasedStr
[src]
impl PartialEq<str> for UncasedStr
fn eq(&self, other: &str) -> bool
[src]
fn eq(&self, other: &str) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<UncasedStr> for str
[src]
impl PartialEq<UncasedStr> for str
fn eq(&self, other: &UncasedStr) -> bool
[src]
fn eq(&self, other: &UncasedStr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a> PartialEq<&'a str> for UncasedStr
[src]
impl<'a> PartialEq<&'a str> for UncasedStr
fn eq(&self, other: &&'a str) -> bool
[src]
fn eq(&self, other: &&'a str) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a> PartialEq<UncasedStr> for &'a str
[src]
impl<'a> PartialEq<UncasedStr> for &'a str
fn eq(&self, other: &UncasedStr) -> bool
[src]
fn eq(&self, other: &UncasedStr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a> From<&'a str> for &'a UncasedStr
[src]
impl<'a> From<&'a str> for &'a UncasedStr
fn from(string: &'a str) -> &'a UncasedStr
[src]
fn from(string: &'a str) -> &'a UncasedStr
Performs the conversion.
impl Eq for UncasedStr
[src]
impl Eq for UncasedStr
impl Hash for UncasedStr
[src]
impl Hash for UncasedStr
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd for UncasedStr
[src]
impl PartialOrd for UncasedStr
fn partial_cmp(&self, other: &UncasedStr) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &UncasedStr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
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
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for UncasedStr
[src]
impl Ord for UncasedStr
fn cmp(&self, other: &Self) -> Ordering
[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Display for UncasedStr
[src]
impl Display for UncasedStr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> AsRef<UncasedStr> for Uncased<'a>
[src]
impl<'a> AsRef<UncasedStr> for Uncased<'a>
fn as_ref(&self) -> &UncasedStr
[src]
fn as_ref(&self) -> &UncasedStr
Performs the conversion.
impl<'a> Borrow<UncasedStr> for Uncased<'a>
[src]
impl<'a> Borrow<UncasedStr> for Uncased<'a>
fn borrow(&self) -> &UncasedStr
[src]
fn borrow(&self) -> &UncasedStr
Immutably borrows from an owned value. Read more
Auto Trait Implementations
impl Send for UncasedStr
impl Send for UncasedStr
impl Sync for UncasedStr
impl Sync for UncasedStr