Trait precis_core::profile::Rules

source ·
pub trait Rules {
    // Provided methods
    fn width_mapping_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
       where T: Into<Cow<'a, str>> { ... }
    fn additional_mapping_rule<'a, T>(
        &self,
        _s: T,
    ) -> Result<Cow<'a, str>, Error>
       where T: Into<Cow<'a, str>> { ... }
    fn case_mapping_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
       where T: Into<Cow<'a, str>> { ... }
    fn normalization_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
       where T: Into<Cow<'a, str>> { ... }
    fn directionality_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
       where T: Into<Cow<'a, str>> { ... }
}
Expand description

Rules that any profile of a PRECIS string class MUST define to proper manage the handling of right-to-left code points as well as various mapping operations such as case preservation or lower casing, Unicode normalization, mapping of certain code points to other code points or to nothing, and mapping of full width and half width code points.

Provided Methods§

source

fn width_mapping_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
where T: Into<Cow<'a, str>>,

Applies the width mapping rule of a profile to an input string.

§Arguments:
  • s: String value
§Returns

The same string if no modifications were required or a new allocated string if s was modified as a result of applying this rule

source

fn additional_mapping_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
where T: Into<Cow<'a, str>>,

Applies the additional mapping rule of a profile to an input string.

§Arguments:
  • s: String value
§Returns

The same string if no modifications were required or a new allocated string if s was modified as a result of applying this rule

source

fn case_mapping_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
where T: Into<Cow<'a, str>>,

Applies the case mapping rule of a profile to an input string

§Arguments:
  • s: String value
§Returns

The same string if no modifications were required or a new allocated string if s was modified as a result of applying this rule

source

fn normalization_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
where T: Into<Cow<'a, str>>,

Applies the normalization rule of a profile to an input string

§Arguments:
  • s: String value
§Returns

The same string if no modifications were required or a new allocated string if s was modified as a result of applying this rule

source

fn directionality_rule<'a, T>(&self, _s: T) -> Result<Cow<'a, str>, Error>
where T: Into<Cow<'a, str>>,

Applies the directionality rule of a profile to an input string

§Arguments:
  • s: String value
§Returns

The same string if no modifications were required or a new allocated string if s was modified as a result of applying this rule

Object Safety§

This trait is not object safe.

Implementors§