[][src]Struct ucd_parse::UnicodeDataDecomposition

pub struct UnicodeDataDecomposition {
    pub tag: Option<UnicodeDataDecompositionTag>,
    pub len: usize,
    pub mapping: [Codepoint; 18],
}

Represents a decomposition mapping of a single row in the UnicodeData.txt file.

Fields

tag: Option<UnicodeDataDecompositionTag>

The formatting tag associated with this mapping, if present.

len: usize

The number of codepoints in this mapping.

mapping: [Codepoint; 18]

The codepoints in the mapping. Entries beyond len in the mapping are always U+0000. If no mapping was present, then this always contains a single codepoint corresponding to this row's character.

Methods

impl UnicodeDataDecomposition[src]

pub fn new(
    tag: Option<UnicodeDataDecompositionTag>,
    mapping: &[Codepoint]
) -> Result<UnicodeDataDecomposition, Error>
[src]

Create a new decomposition mapping with the given tag and codepoints.

If there are too many codepoints, then an error is returned.

pub fn push(&mut self, cp: Codepoint) -> Result<(), Error>[src]

Add a new codepoint to this decomposition's mapping.

If the mapping is already full, then this returns an error.

pub fn mapping(&self) -> &[Codepoint][src]

Return the mapping as a slice of codepoints. The slice returned has length equivalent to the number of codepoints in this mapping.

pub fn is_canonical(&self) -> bool[src]

Returns true if and only if this decomposition mapping is canonical.

Trait Implementations

impl Clone for UnicodeDataDecomposition[src]

impl Debug for UnicodeDataDecomposition[src]

impl Default for UnicodeDataDecomposition[src]

impl Display for UnicodeDataDecomposition[src]

impl Eq for UnicodeDataDecomposition[src]

impl FromStr for UnicodeDataDecomposition[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<UnicodeDataDecomposition> for UnicodeDataDecomposition[src]

impl StructuralEq for UnicodeDataDecomposition[src]

impl StructuralPartialEq for UnicodeDataDecomposition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.