Trait StringClass

Source
pub trait StringClass {
    // Required methods
    fn get_value_from_char(&self, c: char) -> DerivedPropertyValue;
    fn get_value_from_codepoint(&self, cp: u32) -> DerivedPropertyValue;

    // Provided method
    fn allows<S>(&self, label: S) -> Result<(), Error>
       where S: AsRef<str> { ... }
}
Expand description

Base interface for all String classes in PRECIS framework.

Required Methods§

Source

fn get_value_from_char(&self, c: char) -> DerivedPropertyValue

Gets the derived property value according to the algorithm defined in rfc8264

§Arguments
  • c- Unicode character
§Return

This method returns the derived property value associated to a Unicode character

Source

fn get_value_from_codepoint(&self, cp: u32) -> DerivedPropertyValue

Gets the derived property value according to the algorithm defined in rfc8264

§Arguments:
  • cp- Unicode code point
§Return

This method returns the derived property value associated to a Unicode character

Provided Methods§

Source

fn allows<S>(&self, label: S) -> Result<(), Error>
where S: AsRef<str>,

Ensures that the string consists only of Unicode code points that are explicitly allowed by the PRECIS String Class

§Arguments:
  • label - string to check
§Returns

true if all character of label are allowed by the String Class.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§