Struct rocket_http::uncased::UncasedStr [−][src]
#[repr(C)]pub struct UncasedStr(_);Expand description
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();Implementations
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!");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!");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
Performs the conversion.
Immutably borrows from an owned value. Read more
Performs the conversion.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for UncasedStr
impl Send for UncasedStr
impl !Sized for UncasedStr
impl Sync for UncasedStr
impl Unpin for UncasedStr
impl UnwindSafe for UncasedStr
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.