pub struct CasefoldStr(/* private fields */);Expand description
A borrowed slice of a casefolded string.
It is designed to be the borrowed counterpart to CasefoldString, mirroring
the relationship between str and String.
We wrap str instead of a struct like CasefoldStr<'a>(&'a str)
so that CasefoldString can implement Deref<Target = CasefoldStr>. This allows
CasefoldString to coerce to &CasefoldStr automatically, and enables zero-allocation
map lookups via Borrow<CasefoldStr>.
Implementations§
Trait Implementations§
Source§impl Borrow<CasefoldStr> for CasefoldString
impl Borrow<CasefoldStr> for CasefoldString
Source§fn borrow(&self) -> &CasefoldStr
fn borrow(&self) -> &CasefoldStr
Immutably borrows from an owned value. Read more
Source§impl Debug for CasefoldStr
impl Debug for CasefoldStr
Source§impl Display for CasefoldStr
impl Display for CasefoldStr
Source§impl<'a> From<&'a str> for &'a CasefoldStr
impl<'a> From<&'a str> for &'a CasefoldStr
Source§impl Hash for CasefoldStr
impl Hash for CasefoldStr
Source§impl Ord for CasefoldStr
impl Ord for CasefoldStr
Source§impl PartialEq for CasefoldStr
impl PartialEq for CasefoldStr
Source§impl PartialOrd for CasefoldStr
impl PartialOrd for CasefoldStr
Source§impl ToOwned for CasefoldStr
impl ToOwned for CasefoldStr
Source§type Owned = CasefoldString
type Owned = CasefoldString
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more