Trait Casing
trait Casing<T: AsRef<str>>
Describes items that can be converted into a case. This trait is used
in conjunction with the StateConverter struct which is returned from a couple
methods on Casing.
Required Methods
fn to_case(self: &Self, case: Case) -> StringConvert the string into the given case. It will reference
selfand create a newStringwith the same pattern and delimeter ascase. It will split on boundaries defined at [Boundary::defaults()].use ; assert_eq!;fn from_case(self: &Self, case: Case) -> StateConverter<'_, T>Start the case conversion by storing the boundaries associated with the given case.
use ; assert_eq!;fn with_boundaries(self: &Self, bs: &[Boundary]) -> StateConverter<'_, T>Creates a
StateConverterstruct initialized with the boundaries provided.use ; assert_eq!;fn without_boundaries(self: &Self, bs: &[Boundary]) -> StateConverter<'_, T>Creates a
StateConverterstruct initialized without the boundaries provided.use ; assert_eq!;fn is_case(self: &Self, case: Case) -> boolDetermines if
selfis of the given case. This is done simply by applying the conversion and seeing if the result is the same.use ; assert!; assert!; assert!; assert!;
Implementors
impl<T> Casing for T