#[repr(u8)]pub enum GeneralCategory {
Show 30 variants
Unassigned = 0,
UppercaseLetter = 1,
LowercaseLetter = 2,
TitlecaseLetter = 3,
ModifierLetter = 4,
OtherLetter = 5,
NonspacingMark = 6,
EnclosingMark = 7,
SpacingMark = 8,
DecimalNumber = 9,
LetterNumber = 10,
OtherNumber = 11,
SpaceSeparator = 12,
LineSeparator = 13,
ParagraphSeparator = 14,
Control = 15,
Format = 16,
PrivateUse = 17,
Surrogate = 18,
DashPunctuation = 19,
OpenPunctuation = 20,
ClosePunctuation = 21,
ConnectorPunctuation = 22,
OtherPunctuation = 23,
MathSymbol = 24,
CurrencySymbol = 25,
ModifierSymbol = 26,
OtherSymbol = 27,
InitialPunctuation = 28,
FinalPunctuation = 29,
}Expand description
Enumerated property General_Category.
General_Category specifies the most general classification of a code point, usually
determined based on the primary characteristic of the assigned character. For example, is the
character a letter, a mark, a number, punctuation, or a symbol, and if so, of what type?
GeneralCategory only supports specific subcategories (eg UppercaseLetter).
It does not support grouped categories (eg Letter). For grouped categories, use GeneralCategoryGroup.
§Example
use icu::properties::{CodePointMapData, props::GeneralCategory};
assert_eq!(
CodePointMapData::<GeneralCategory>::new().get('木'),
GeneralCategory::OtherLetter
); // U+6728
assert_eq!(
CodePointMapData::<GeneralCategory>::new().get('🎃'),
GeneralCategory::OtherSymbol
); // U+1F383 JACK-O-LANTERNVariants§
Unassigned = 0
UppercaseLetter = 1
LowercaseLetter = 2
TitlecaseLetter = 3
ModifierLetter = 4
OtherLetter = 5
NonspacingMark = 6
EnclosingMark = 7
SpacingMark = 8
DecimalNumber = 9
LetterNumber = 10
OtherNumber = 11
SpaceSeparator = 12
LineSeparator = 13
ParagraphSeparator = 14
Control = 15
Format = 16
PrivateUse = 17
Surrogate = 18
DashPunctuation = 19
OpenPunctuation = 20
ClosePunctuation = 21
ConnectorPunctuation = 22
OtherPunctuation = 23
MathSymbol = 24
CurrencySymbol = 25
ModifierSymbol = 26
OtherSymbol = 27
InitialPunctuation = 28
FinalPunctuation = 29
Implementations§
Source§impl GeneralCategory
impl GeneralCategory
pub const Cn: Self = Self::Unassigned
pub const Lu: Self = Self::UppercaseLetter
pub const Ll: Self = Self::LowercaseLetter
pub const Lt: Self = Self::TitlecaseLetter
pub const Lm: Self = Self::ModifierLetter
pub const Lo: Self = Self::OtherLetter
pub const Mn: Self = Self::NonspacingMark
pub const Me: Self = Self::EnclosingMark
pub const Mc: Self = Self::SpacingMark
pub const Nd: Self = Self::DecimalNumber
pub const Digit: Self = Self::DecimalNumber
pub const Nl: Self = Self::LetterNumber
pub const No: Self = Self::OtherNumber
pub const Zs: Self = Self::SpaceSeparator
pub const Zl: Self = Self::LineSeparator
pub const Zp: Self = Self::ParagraphSeparator
pub const Cc: Self = Self::Control
pub const Cntrl: Self = Self::Control
pub const Cf: Self = Self::Format
pub const Co: Self = Self::PrivateUse
pub const Cs: Self = Self::Surrogate
pub const Pd: Self = Self::DashPunctuation
pub const Ps: Self = Self::OpenPunctuation
pub const Pe: Self = Self::ClosePunctuation
pub const Pc: Self = Self::ConnectorPunctuation
pub const Po: Self = Self::OtherPunctuation
pub const Sm: Self = Self::MathSymbol
pub const Sc: Self = Self::CurrencySymbol
pub const Sk: Self = Self::ModifierSymbol
pub const So: Self = Self::OtherSymbol
pub const Pi: Self = Self::InitialPunctuation
pub const Pf: Self = Self::FinalPunctuation
Source§impl GeneralCategory
impl GeneralCategory
Sourcepub const ALL_VALUES: &'static [Self]
👎Deprecated
pub const ALL_VALUES: &'static [Self]
Deprecated
Trait Implementations§
Source§impl AsULE for GeneralCategory
impl AsULE for GeneralCategory
Source§type ULE = GeneralCategoryULE
type ULE = GeneralCategoryULE
The ULE type corresponding to
Self. Read moreSource§fn to_unaligned(self) -> Self::ULE
fn to_unaligned(self) -> Self::ULE
Source§fn from_unaligned(other: Self::ULE) -> Self
fn from_unaligned(other: Self::ULE) -> Self
Source§impl Clone for GeneralCategory
impl Clone for GeneralCategory
Source§fn clone(&self) -> GeneralCategory
fn clone(&self) -> GeneralCategory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GeneralCategory
Source§impl Debug for GeneralCategory
impl Debug for GeneralCategory
Source§impl Default for GeneralCategory
impl Default for GeneralCategory
Source§impl EnumeratedProperty for GeneralCategory
impl EnumeratedProperty for GeneralCategory
impl Eq for GeneralCategory
Source§impl From<GeneralCategory> for u16
impl From<GeneralCategory> for u16
Source§fn from(other: GeneralCategory) -> Self
fn from(other: GeneralCategory) -> Self
Converts to this type from the input type.
Source§impl From<GeneralCategory> for GeneralCategoryGroup
impl From<GeneralCategory> for GeneralCategoryGroup
Source§fn from(subcategory: GeneralCategory) -> Self
fn from(subcategory: GeneralCategory) -> Self
Converts to this type from the input type.
Source§impl Hash for GeneralCategory
impl Hash for GeneralCategory
Source§impl NamedEnumeratedProperty for GeneralCategory
impl NamedEnumeratedProperty for GeneralCategory
Source§fn try_from_str(s: &str) -> Option<Self>
fn try_from_str(s: &str) -> Option<Self>
Convenience method for
PropertyParser::new().get_loose(s) Read moreSource§fn long_name(&self) -> &'static str
fn long_name(&self) -> &'static str
Convenience method for
PropertyNamesLong::new().get(*self).unwrap() Read moreSource§fn short_name(&self) -> &'static str
fn short_name(&self) -> &'static str
Convenience method for
PropertyNamesShort::new().get(*self).unwrap() Read moreSource§impl Ord for GeneralCategory
impl Ord for GeneralCategory
Source§fn cmp(&self, other: &GeneralCategory) -> Ordering
fn cmp(&self, other: &GeneralCategory) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
impl ParseableEnumeratedProperty for GeneralCategory
Source§impl PartialEq for GeneralCategory
impl PartialEq for GeneralCategory
Source§impl PartialOrd for GeneralCategory
impl PartialOrd for GeneralCategory
impl StructuralPartialEq for GeneralCategory
Source§impl TrieValue for GeneralCategory
impl TrieValue for GeneralCategory
Source§type TryFromU32Error = &'static str
type TryFromU32Error = &'static str
Last-resort fallback value to return if we cannot read data from the trie. Read more
Source§fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
A parsing function that is primarily motivated by deserialization contexts.
When the serialization type width is smaller than 32 bits, then it is expected
that the call site will widen the value to a
u32 first.Source§impl TryFrom<u8> for GeneralCategory
impl TryFrom<u8> for GeneralCategory
Source§fn try_from(val: u8) -> Result<Self, GeneralCategoryOutOfBoundsError>
fn try_from(val: u8) -> Result<Self, GeneralCategoryOutOfBoundsError>
Construct this GeneralCategory from an integer, returning
an error if it is out of bounds
Source§type Error = GeneralCategoryOutOfBoundsError
type Error = GeneralCategoryOutOfBoundsError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for GeneralCategory
impl RefUnwindSafe for GeneralCategory
impl Send for GeneralCategory
impl Sync for GeneralCategory
impl Unpin for GeneralCategory
impl UnsafeUnpin for GeneralCategory
impl UnwindSafe for GeneralCategory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more