pub struct UnicodeDataDecomposition {
pub tag: Option<UnicodeDataDecompositionTag>,
pub len: usize,
pub mapping: [Codepoint; 18],
}
Expand description
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.
Implementations
sourceimpl UnicodeDataDecomposition
impl UnicodeDataDecomposition
sourcepub fn new(
tag: Option<UnicodeDataDecompositionTag>,
mapping: &[Codepoint]
) -> Result<UnicodeDataDecomposition, Error>
pub fn new(
tag: Option<UnicodeDataDecompositionTag>,
mapping: &[Codepoint]
) -> Result<UnicodeDataDecomposition, Error>
Create a new decomposition mapping with the given tag and codepoints.
If there are too many codepoints, then an error is returned.
sourcepub fn push(&mut self, cp: Codepoint) -> Result<(), Error>
pub fn push(&mut self, cp: Codepoint) -> Result<(), Error>
Add a new codepoint to this decomposition’s mapping.
If the mapping is already full, then this returns an error.
sourcepub fn mapping(&self) -> &[Codepoint]
pub fn mapping(&self) -> &[Codepoint]
Return the mapping as a slice of codepoints. The slice returned has length equivalent to the number of codepoints in this mapping.
sourcepub fn is_canonical(&self) -> bool
pub fn is_canonical(&self) -> bool
Returns true if and only if this decomposition mapping is canonical.
Trait Implementations
sourceimpl Clone for UnicodeDataDecomposition
impl Clone for UnicodeDataDecomposition
sourcefn clone(&self) -> UnicodeDataDecomposition
fn clone(&self) -> UnicodeDataDecomposition
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more