Struct ucd_parse::UnicodeDataDecomposition
[−]
[src]
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]
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.
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]
fn clone(&self) -> UnicodeDataDecomposition[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for UnicodeDataDecomposition[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Default for UnicodeDataDecomposition[src]
fn default() -> UnicodeDataDecomposition[src]
Returns the "default value" for a type. Read more
impl Eq for UnicodeDataDecomposition[src]
impl PartialEq for UnicodeDataDecomposition[src]
fn eq(&self, __arg_0: &UnicodeDataDecomposition) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &UnicodeDataDecomposition) -> bool[src]
This method tests for !=.
impl FromStr for UnicodeDataDecomposition[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<UnicodeDataDecomposition, Error>[src]
Parses a string s to return a value of this type. Read more