Struct icu_properties::Script
source · #[repr(transparent)]pub struct Script(pub u16);
Expand description
Enumerated property Script.
This is used with both the Script and Script_Extensions Unicode properties. Each character is assigned a single Script, but characters that are used in a particular subset of scripts will be in more than one Script_Extensions set. For example, DEVANAGARI DIGIT NINE has Script=Devanagari, but is also in the Script_Extensions set for Dogra, Kaithi, and Mahajani.
For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
See UScriptCode
in ICU4C.
Tuple Fields§
§0: u16
Implementations§
source§impl Script
impl Script
pub const Adlam: Script = _
pub const Ahom: Script = _
pub const AnatolianHieroglyphs: Script = _
pub const Arabic: Script = _
pub const Armenian: Script = _
pub const Avestan: Script = _
pub const Balinese: Script = _
pub const Bamum: Script = _
pub const BassaVah: Script = _
pub const Batak: Script = _
pub const Bengali: Script = _
pub const Bhaiksuki: Script = _
pub const Bopomofo: Script = _
pub const Brahmi: Script = _
pub const Braille: Script = _
pub const Buginese: Script = _
pub const Buhid: Script = _
pub const CanadianAboriginal: Script = _
pub const Carian: Script = _
pub const CaucasianAlbanian: Script = _
pub const Chakma: Script = _
pub const Cham: Script = _
pub const Cherokee: Script = _
pub const Chorasmian: Script = _
pub const Common: Script = _
pub const Coptic: Script = _
pub const Cuneiform: Script = _
pub const Cypriot: Script = _
pub const CyproMinoan: Script = _
pub const Cyrillic: Script = _
pub const Deseret: Script = _
pub const Devanagari: Script = _
pub const DivesAkuru: Script = _
pub const Dogra: Script = _
pub const Duployan: Script = _
pub const EgyptianHieroglyphs: Script = _
pub const Elbasan: Script = _
pub const Elymaic: Script = _
pub const Ethiopian: Script = _
pub const Georgian: Script = _
pub const Glagolitic: Script = _
pub const Gothic: Script = _
pub const Grantha: Script = _
pub const Greek: Script = _
pub const Gujarati: Script = _
pub const GunjalaGondi: Script = _
pub const Gurmukhi: Script = _
pub const Han: Script = _
pub const Hangul: Script = _
pub const HanifiRohingya: Script = _
pub const Hanunoo: Script = _
pub const Hatran: Script = _
pub const Hebrew: Script = _
pub const Hiragana: Script = _
pub const ImperialAramaic: Script = _
pub const Inherited: Script = _
pub const InscriptionalPahlavi: Script = _
pub const InscriptionalParthian: Script = _
pub const Javanese: Script = _
pub const Kaithi: Script = _
pub const Kannada: Script = _
pub const Katakana: Script = _
pub const Kawi: Script = _
pub const KayahLi: Script = _
pub const Kharoshthi: Script = _
pub const KhitanSmallScript: Script = _
pub const Khmer: Script = _
pub const Khojki: Script = _
pub const Khudawadi: Script = _
pub const Lao: Script = _
pub const Latin: Script = _
pub const Lepcha: Script = _
pub const Limbu: Script = _
pub const LinearA: Script = _
pub const LinearB: Script = _
pub const Lisu: Script = _
pub const Lycian: Script = _
pub const Lydian: Script = _
pub const Mahajani: Script = _
pub const Makasar: Script = _
pub const Malayalam: Script = _
pub const Mandaic: Script = _
pub const Manichaean: Script = _
pub const Marchen: Script = _
pub const MasaramGondi: Script = _
pub const Medefaidrin: Script = _
pub const MeeteiMayek: Script = _
pub const MendeKikakui: Script = _
pub const MeroiticCursive: Script = _
pub const MeroiticHieroglyphs: Script = _
pub const Miao: Script = _
pub const Modi: Script = _
pub const Mongolian: Script = _
pub const Mro: Script = _
pub const Multani: Script = _
pub const Myanmar: Script = _
pub const Nabataean: Script = _
pub const NagMundari: Script = _
pub const Nandinagari: Script = _
pub const Nastaliq: Script = _
pub const NewTaiLue: Script = _
pub const Newa: Script = _
pub const Nko: Script = _
pub const Nushu: Script = _
pub const NyiakengPuachueHmong: Script = _
pub const Ogham: Script = _
pub const OlChiki: Script = _
pub const OldHungarian: Script = _
pub const OldItalic: Script = _
pub const OldNorthArabian: Script = _
pub const OldPermic: Script = _
pub const OldPersian: Script = _
pub const OldSogdian: Script = _
pub const OldSouthArabian: Script = _
pub const OldTurkic: Script = _
pub const OldUyghur: Script = _
pub const Oriya: Script = _
pub const Osage: Script = _
pub const Osmanya: Script = _
pub const PahawhHmong: Script = _
pub const Palmyrene: Script = _
pub const PauCinHau: Script = _
pub const PhagsPa: Script = _
pub const Phoenician: Script = _
pub const PsalterPahlavi: Script = _
pub const Rejang: Script = _
pub const Runic: Script = _
pub const Samaritan: Script = _
pub const Saurashtra: Script = _
pub const Sharada: Script = _
pub const Shavian: Script = _
pub const Siddham: Script = _
pub const SignWriting: Script = _
pub const Sinhala: Script = _
pub const Sogdian: Script = _
pub const SoraSompeng: Script = _
pub const Soyombo: Script = _
pub const Sundanese: Script = _
pub const SylotiNagri: Script = _
pub const Syriac: Script = _
pub const Tagalog: Script = _
pub const Tagbanwa: Script = _
pub const TaiLe: Script = _
pub const TaiTham: Script = _
pub const TaiViet: Script = _
pub const Takri: Script = _
pub const Tamil: Script = _
pub const Tangsa: Script = _
pub const Tangut: Script = _
pub const Telugu: Script = _
pub const Thaana: Script = _
pub const Thai: Script = _
pub const Tibetan: Script = _
pub const Tifinagh: Script = _
pub const Tirhuta: Script = _
pub const Toto: Script = _
pub const Ugaritic: Script = _
pub const Unknown: Script = _
pub const Vai: Script = _
pub const Vithkuqi: Script = _
pub const Wancho: Script = _
pub const WarangCiti: Script = _
pub const Yezidi: Script = _
pub const Yi: Script = _
pub const ZanabazarSquare: Script = _
source§impl Script
impl Script
sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, Script>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, Script>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Script
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::Script;
let lookup = Script::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("Brah"), Some(Script::Brahmi));
assert_eq!(lookup.get_strict("Hang"), Some(Script::Hangul));
// long name for value
assert_eq!(lookup.get_strict("Brahmi"), Some(Script::Brahmi));
assert_eq!(lookup.get_strict("Hangul"), Some(Script::Hangul));
// name has incorrect casing
assert_eq!(lookup.get_strict("brahmi"), None);
// loose matching of name
assert_eq!(lookup.get_loose("brahmi"), Some(Script::Brahmi));
// fake property
assert_eq!(lookup.get_strict("Linear_Z"), None);
sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<ScriptNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<Script>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<ScriptNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<Script>, PropertiesError>
A version of Script::name_to_enum_mapper()
that uses custom data provided by a DataProvider
.
sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, Script>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, Script>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Script
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::Script;
use tinystr::tinystr;
let lookup = Script::enum_to_short_name_mapper();
assert_eq!(lookup.get(Script::Brahmi), Some(tinystr!(4, "Brah")));
assert_eq!(lookup.get(Script::Hangul), Some(tinystr!(4, "Hang")));
sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<ScriptValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearTiny4Mapper<Script>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<ScriptValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearTiny4Mapper<Script>, PropertiesError>
A version of Script::enum_to_short_name_mapper()
that uses custom data provided by a DataProvider
.
sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, Script>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, Script>
Return a PropertyEnumToValueNameLinearTiny4Mapper
, capable of looking up long names
for values of the Script
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::Script;
let lookup = Script::enum_to_long_name_mapper();
assert_eq!(lookup.get(Script::Brahmi), Some("Brahmi"));
assert_eq!(lookup.get(Script::Hangul), Some("Hangul"));
sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<ScriptValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<Script>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<ScriptValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<Script>, PropertiesError>
A version of Script::enum_to_long_name_mapper()
that uses custom data provided by a DataProvider
.
Trait Implementations§
source§impl Ord for Script
impl Ord for Script
source§impl PartialOrd for Script
impl PartialOrd for Script
source§impl TrieValue for Script
impl TrieValue for Script
source§type TryFromU32Error = TryFromIntError
type TryFromU32Error = TryFromIntError
source§fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
u32
first.source§impl<'a> ZeroMapKV<'a> for Script
impl<'a> ZeroMapKV<'a> for Script
impl Copy for Script
impl Eq for Script
impl StructuralPartialEq for Script
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)