Skip to main content

StringCasesExt

Trait StringCasesExt 

Source
pub trait StringCasesExt {
    // Required methods
    fn to_snake_case(&self) -> String;
    fn to_kebab_case(&self) -> String;
    fn to_camel_case(&self) -> String;
    fn to_pascal_case(&self) -> String;
}
Expand description

Extension trait for adding methods

Required Methods§

Source

fn to_snake_case(&self) -> String

‘_’ defines boundaries

Source

fn to_kebab_case(&self) -> String

‘-’ defines boundaries

Source

fn to_camel_case(&self) -> String

Differences in cases define boundaries

Source

fn to_pascal_case(&self) -> String

Differences in cases define boundaries. First character is always uppercase

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> StringCasesExt for T
where T: Deref<Target = str>,