Struct precis_profiles::Nickname [−][src]
pub struct Nickname { /* fields omitted */ }Expand description
Nickname.
Nicknames or display names in messaging and text conferencing technologies;
pet names for devices, accounts, and people; and other uses of nicknames,
display names, or pet names. Look at the
IANA Considerations
section for more details.
Example
use precis_core::profile::Profile;
use precis_profiles::Nickname;
use std::borrow::Cow;
// create Nickname profile
let profile = Nickname::new();
// prepare string
assert_eq!(profile.prepare("Guybrush Threepwood"),
Ok(Cow::from("Guybrush Threepwood")));
// enforce string
assert_eq!(profile.enforce(" Guybrush Threepwood "),
Ok(Cow::from("Guybrush Threepwood")));
// compare strings
assert_eq!(profile.compare("Guybrush Threepwood ",
"guybrush threepwood"), Ok(true));Implementations
Trait Implementations
Ensures that the code points in a single input string are allowed by the underlying PRECIS string class, and sometimes also entails applying one or more of the rules specified for a particular string class or profile thereof. Read more
Applies all rules specified for a particular string class, or profile thereof, to a single input string, for the purpose of checking whether the string conforms to all the rules and thus determining if the string can be used in a given protocol slot. Read more
Ensures that the code points in a single input string are allowed by the underlying PRECIS string class, and sometimes also entails applying one or more of the rules specified for a particular string class or profile thereof. Read more
Applies all the rules specified for a particular string class, or profile thereof, to a single input string, for the purpose of checking whether the string conforms to all the rules and thus determining if the string can be used in a given protocol slot. Read more