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
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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UnicodeDataDecomposition
impl Debug for UnicodeDataDecomposition
sourceimpl Default for UnicodeDataDecomposition
impl Default for UnicodeDataDecomposition
sourcefn default() -> UnicodeDataDecomposition
fn default() -> UnicodeDataDecomposition
Returns the “default value” for a type. Read more
sourceimpl Display for UnicodeDataDecomposition
impl Display for UnicodeDataDecomposition
sourceimpl FromStr for UnicodeDataDecomposition
impl FromStr for UnicodeDataDecomposition
sourceimpl PartialEq<UnicodeDataDecomposition> for UnicodeDataDecomposition
impl PartialEq<UnicodeDataDecomposition> for UnicodeDataDecomposition
sourcefn eq(&self, other: &UnicodeDataDecomposition) -> bool
fn eq(&self, other: &UnicodeDataDecomposition) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Eq for UnicodeDataDecomposition
impl StructuralEq for UnicodeDataDecomposition
impl StructuralPartialEq for UnicodeDataDecomposition
Auto Trait Implementations
impl RefUnwindSafe for UnicodeDataDecomposition
impl Send for UnicodeDataDecomposition
impl Sync for UnicodeDataDecomposition
impl Unpin for UnicodeDataDecomposition
impl UnwindSafe for UnicodeDataDecomposition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more