Struct precis_tools::UnicodeData

source ·
pub struct UnicodeData {
Show 15 fields pub codepoints: Codepoints, pub name: String, pub general_category: String, pub canonical_combining_class: u8, pub bidi_class: String, pub decomposition: UnicodeDataDecomposition, pub numeric_type_decimal: Option<u8>, pub numeric_type_digit: Option<u8>, pub numeric_type_numeric: Option<UnicodeDataNumeric>, pub bidi_mirrored: bool, pub unicode1_name: String, pub iso_comment: String, pub simple_uppercase_mapping: Option<Codepoint>, pub simple_lowercase_mapping: Option<Codepoint>, pub simple_titlecase_mapping: Option<Codepoint>,
}
Expand description

Extension of the UnicodeData struct provided by the ucd_parse crate. Unlike the original one, this struct does not represent a single line in the UnicodeData file, but it could be the result of a whole parsing of several files to contain range of Unicode code points. Note that this file, unlike others in the Unicode data files, represents ranges split in different lines in order not to break parsers compatibility.

Fields§

§codepoints: Codepoints

The code points corresponding to this row.

§name: String

The name of this code point.

§general_category: String

The “general category” of this code point.

§canonical_combining_class: u8

The class of this code point used in the Canonical Ordering Algorithm.

Note that some classes map to a particular symbol. See UAX44, Table 15.

§bidi_class: String

The bidirectional class of this code point.

Possible values are listed in UAX44, Table 13.

§decomposition: UnicodeDataDecomposition

The decomposition mapping for this code point. This includes its formatting tag (if present).

§numeric_type_decimal: Option<u8>

A decimal numeric representation of this code point, if it has the property Numeric_Type=Decimal.

§numeric_type_digit: Option<u8>

A decimal numeric representation of this code point, if it has the property Numeric_Type=Digit. Note that while this field is still populated for existing code points, no new code points will have this field populated.

§numeric_type_numeric: Option<UnicodeDataNumeric>

A decimal or rational numeric representation of this code point, if it has the property Numeric_Type=Numeric.

§bidi_mirrored: bool

A Boolean indicating whether this code point is “mirrored” in bidirectional text.

§unicode1_name: String

The “old” Unicode 1.0 or ISO 6429 name of this code point. Note that this field is empty unless it is significantly different from the name field.

§iso_comment: String

The ISO 10464 comment field. This field no longer contains any non-NULL values.

§simple_uppercase_mapping: Option<Codepoint>

This code point’s simple uppercase mapping, if it exists.

§simple_lowercase_mapping: Option<Codepoint>

This code point’s simple lowercase mapping, if it exists.

§simple_titlecase_mapping: Option<Codepoint>

This code point’s simple title case mapping, if it exists.

Implementations§

source§

impl UnicodeData

source

pub fn parse(ucd_dir: &Path) -> Result<Vec<UnicodeData>, Error>

Parse a particular UCD file into a sequence of rows.

Trait Implementations§

source§

impl Clone for UnicodeData

source§

fn clone(&self) -> UnicodeData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnicodeData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for UnicodeData

source§

fn default() -> UnicodeData

Returns the “default value” for a type. Read more
source§

impl PartialEq for UnicodeData

source§

fn eq(&self, other: &UnicodeData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl UcdLineParser<UnicodeData> for BidiClassGen

source§

fn process_entry(&mut self, udata: &UnicodeData) -> Result<(), Error>

Process an entry in the UCD file. Read more
source§

impl UcdLineParser<UnicodeData> for UcdTableGen

source§

fn process_entry(&mut self, udata: &UnicodeData) -> Result<(), Error>

Process an entry in the UCD file. Read more
source§

impl UcdLineParser<UnicodeData> for UnassignedTableGen

source§

fn process_entry(&mut self, udata: &UnicodeData) -> Result<(), Error>

Process an entry in the UCD file. Read more
source§

impl UcdLineParser<UnicodeData> for ViramaTableGen

source§

fn process_entry(&mut self, udata: &UnicodeData) -> Result<(), Error>

Process an entry in the UCD file. Read more
source§

impl UcdLineParser<UnicodeData> for WidthMappingTableGen

source§

fn process_entry(&mut self, udata: &UnicodeData) -> Result<(), Error>

Process an entry in the UCD file. Read more
source§

impl Eq for UnicodeData

source§

impl StructuralPartialEq for UnicodeData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.