heck

Trait ToTrainCase

Source
pub trait ToTrainCase: ToOwned {
    // Required method
    fn to_train_case(&self) -> Self::Owned;
}
Expand description

This trait defines a train case conversion.

In Train-Case, word boundaries are indicated by hyphens and words start with Capital Letters.

§Example:

use heck::ToTrainCase;

let sentence = "We are going to inherit the earth.";
assert_eq!(sentence.to_train_case(), "We-Are-Going-To-Inherit-The-Earth");

Required Methods§

Source

fn to_train_case(&self) -> Self::Owned

Convert this type to Train-Case.

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.

Implementations on Foreign Types§

Source§

impl ToTrainCase for str

Source§

fn to_train_case(&self) -> Self::Owned

Implementors§