Struct precis_profiles::Nickname
source · pub struct Nickname(/* private fields */);
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
// 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§
source§impl PrecisFastInvocation for Nickname
impl PrecisFastInvocation for Nickname
source§fn prepare<'a, S>(s: S) -> Result<Cow<'a, str>, Error>
fn prepare<'a, S>(s: S) -> Result<Cow<'a, str>, Error>
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
source§fn enforce<'a, S>(s: S) -> Result<Cow<'a, str>, Error>
fn enforce<'a, S>(s: S) -> Result<Cow<'a, str>, Error>
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
source§impl Profile for Nickname
impl Profile for Nickname
source§fn prepare<'a, S>(&self, s: S) -> Result<Cow<'a, str>, Error>
fn prepare<'a, S>(&self, s: S) -> Result<Cow<'a, str>, Error>
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
source§fn enforce<'a, S>(&self, s: S) -> Result<Cow<'a, str>, Error>
fn enforce<'a, S>(&self, s: S) -> Result<Cow<'a, str>, Error>
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
source§impl Rules for Nickname
impl Rules for Nickname
source§fn additional_mapping_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
fn additional_mapping_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
Applies the additional mapping rule of a profile to an input string. Read more
source§fn case_mapping_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
fn case_mapping_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
Applies the case mapping rule of a profile to an input string Read more
source§fn normalization_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
fn normalization_rule<'a, T>(&self, s: T) -> Result<Cow<'a, str>, Error>
Applies the normalization rule of a profile to an input string Read more
impl Copy for Nickname
impl Eq for Nickname
impl StructuralPartialEq for Nickname
Auto Trait Implementations§
impl Freeze for Nickname
impl RefUnwindSafe for Nickname
impl Send for Nickname
impl Sync for Nickname
impl Unpin for Nickname
impl UnwindSafe for Nickname
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)