Skip to main content

CaselessStr

Struct CaselessStr 

Source
pub struct CaselessStr(/* private fields */);
Expand description

A case-insensitive str with repr(transparent) layout.

Equality and hashing are performed case-insensitively (ASCII case folding). This is used for iCalendar property and parameter names (RFC 5545 §3.1).

Implementations§

Source§

impl CaselessStr

Source

pub fn new(s: &str) -> &Self

Wraps a &str as a &CaselessStr.

Source

pub fn as_str(&self) -> &str

Returns the underlying string slice.

Source

pub fn from_box_str(value: Box<str>) -> Box<CaselessStr>

Converts a Box<str> into a Box<CaselessStr>.

Source

pub fn into_box_str(self: Box<Self>) -> Box<str>

Converts a Box<CaselessStr> into a Box<str>.

Trait Implementations§

Source§

impl Clone for Box<CaselessStr>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CaselessStr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CaselessStr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a str> for &'a CaselessStr

Source§

fn from(value: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Box<CaselessStr>

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<Box<str>> for Box<CaselessStr>

Source§

fn from(value: Box<str>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Box<CaselessStr>

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl Hash for CaselessStr

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl PartialEq<str> for CaselessStr

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for CaselessStr

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CaselessStr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more