pub trait Casing: ToOwned {
type Character: Copy + Eq;
// Required methods
fn upper(&self, _: Locale) -> Cow<'_, Self>;
fn lower(&self, _: Locale) -> Cow<'_, Self>;
fn capitalized(&self, _: Locale) -> Cow<'_, Self>;
fn camel(
&self,
separators: Separator<&[Self::Character]>,
mode: Camel,
_: Locale,
) -> Cow<'_, Self>;
fn separated(
&self,
separator: Separator<Self::Character>,
_: Locale,
) -> Cow<'_, Self>;
fn header(&self, _: Locale) -> Cow<'_, Self>;
}Expand description
Trait with casing extensions.
Required Associated Types§
Required Methods§
Sourcefn upper(&self, _: Locale) -> Cow<'_, Self>
fn upper(&self, _: Locale) -> Cow<'_, Self>
Turns Self to upper case avoiding allocations if nothing would change.
Sourcefn lower(&self, _: Locale) -> Cow<'_, Self>
fn lower(&self, _: Locale) -> Cow<'_, Self>
Turns Self to lower case avoiding allocations if nothing would change.
Sourcefn capitalized(&self, _: Locale) -> Cow<'_, Self>
fn capitalized(&self, _: Locale) -> Cow<'_, Self>
Turns Self to its capitalized version, turning the first character to
upper case and the rest to lower case.
Sourcefn camel(
&self,
separators: Separator<&[Self::Character]>,
mode: Camel,
_: Locale,
) -> Cow<'_, Self>
fn camel( &self, separators: Separator<&[Self::Character]>, mode: Camel, _: Locale, ) -> Cow<'_, Self>
Turns Self to camel case using the passed Separator to know which
symbols should mark a new word.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.