Struct ucd_parse::UnicodeDataDecomposition
source · 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§
source§impl 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§
source§impl Clone for UnicodeDataDecomposition
impl Clone for UnicodeDataDecomposition
source§fn clone(&self) -> UnicodeDataDecomposition
fn clone(&self) -> UnicodeDataDecomposition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UnicodeDataDecomposition
impl Debug for UnicodeDataDecomposition
source§impl Default for UnicodeDataDecomposition
impl Default for UnicodeDataDecomposition
source§fn default() -> UnicodeDataDecomposition
fn default() -> UnicodeDataDecomposition
source§impl Display for UnicodeDataDecomposition
impl Display for UnicodeDataDecomposition
source§impl FromStr for UnicodeDataDecomposition
impl FromStr for UnicodeDataDecomposition
source§impl PartialEq for UnicodeDataDecomposition
impl PartialEq for UnicodeDataDecomposition
source§fn eq(&self, other: &UnicodeDataDecomposition) -> bool
fn eq(&self, other: &UnicodeDataDecomposition) -> bool
self
and other
values to be equal, and is used
by ==
.