Trait heck::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ToTrainCase for str

source§

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

Implementors§