Expand description
§Alphabetic
“Alphabetic” is simple crate featuring AlphabeticLetter struct, that represents a letter in Latin-script alphabet.
Provides AlphabeticLetter::shift() method that shifts forward or backward in alphabet. Wraps around when reaching the end.
§Examples
let mut letter = AlphabeticLetter::try_from('A')?;
letter.shift(5);
assert_eq!(char::from(letter),'F');Changing first letter of a string:
let mut vector = AlphabeticLetter::try_from_string("Rust").unwrap();
vector.first_mut().unwrap().shift(-5);
let new_string = vector.into_iter().map(char::from).collect::<String>();
assert_eq!(new_string, "Must");Structs§
- Alphabetic
Letter - A type representing a letter of Latin-script alphabet.
- NotAlphabetic
Error - The generic error type for conversion.
Enums§
- Letter
Case - A type representing a letter case.
Type Aliases§
- Result
- Result of a value conversion process.