Enum Pattern
enum Pattern
A pattern is how a set of words is mutated before joining with a delimeter.
The Random and PseudoRandom patterns are used for their respective cases
and are only available in the "random" feature.
Variants
-
Lowercase Lowercase patterns make all words lowercase.
# use Pattern; assert_eq!;-
Uppercase Uppercase patterns make all words uppercase.
# use Pattern; assert_eq!;-
Capital Capital patterns makes the first letter of each word uppercase and the remaining letters of each word lowercase.
# use Pattern; assert_eq!;-
Sentence Capital patterns make the first word capitalized and the remaining lowercase.
# use Pattern; assert_eq!;-
Camel Camel patterns make the first word lowercase and the remaining capitalized.
# use Pattern; assert_eq!;-
Alternating Alternating patterns make each letter of each word alternate between lowercase and uppercase. They alternate across words, which means the last letter of one word and the first letter of the next will not be the same letter casing.
# use Pattern; assert_eq!; assert_eq!;-
Toggle Toggle patterns have the first letter of each word uppercase and the remaining letters of each word uppercase.
# use Pattern; assert_eq!;
Implementations
impl Pattern
fn mutate(self: &Self, words: &[&str]) -> Vec<String>Generates a vector of new
Strings in the right pattern given the input strings.# use Pattern; assert_eq!
impl Clone for Pattern
fn clone(self: &Self) -> Pattern
impl Copy for Pattern
impl Debug for Pattern
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Pattern
impl Freeze for Pattern
impl PartialEq for Pattern
fn eq(self: &Self, other: &Pattern) -> bool
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl StructuralPartialEq for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
impl<T> Any for Pattern
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Pattern
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Pattern
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Pattern
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Pattern
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Pattern
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Pattern
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Pattern
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Pattern
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>