Struct unicode_script::ScriptExtension
source · #[non_exhaustive]pub struct ScriptExtension { /* private fields */ }
Expand description
A value for the Script_Extension
property
ScriptExtension
is one or more Script
This is essentially an optimized version of Vec<Script>
that uses bitfields
Implementations§
source§impl ScriptExtension
impl ScriptExtension
sourcepub const fn is_inherited(self) -> bool
pub const fn is_inherited(self) -> bool
Checks if the script extension is Inherited
sourcepub fn intersect_with(&mut self, other: Self)
pub fn intersect_with(&mut self, other: Self)
Intersect this ScriptExtension
with another ScriptExtension
. Produces Unknown
if things
do not intersect. This is equivalent to ScriptExtension::intersection
but it stores the result
in self
“Common” (Zyyy
) and “Inherited” (Zinh
) are considered as intersecting
everything, the intersection of Common
and Inherited
is Inherited
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Find the intersection between two ScriptExtensions. Returns Unknown if things do not intersect.
“Common” (Zyyy
) and “Inherited” (Zinh
) are considered as intersecting
everything, the intersection of Common
and Inherited
is Inherited
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Find the union between two ScriptExtensions.
“Common” (Zyyy
) and “Inherited” (Zinh
) are considered as intersecting
everything, the union of Common
and Inherited
is Common
sourcepub fn contains_script(self, script: Script) -> bool
pub fn contains_script(self, script: Script) -> bool
Check if this ScriptExtension contains the given script
Should be used with specific scripts only, this will
return true
if self
is not Unknown
and script
is
Common
or Inherited
sourcepub fn for_str(x: &str) -> Self
pub fn for_str(x: &str) -> Self
Get the intersection of script extensions of all characters in a string.
sourcepub fn iter(self) -> ScriptIterator ⓘ
pub fn iter(self) -> ScriptIterator ⓘ
Iterate over the scripts in this script extension
Will never yield Script::Unknown
Trait Implementations§
source§impl Clone for ScriptExtension
impl Clone for ScriptExtension
source§fn clone(&self) -> ScriptExtension
fn clone(&self) -> ScriptExtension
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScriptExtension
impl Debug for ScriptExtension
source§impl Default for ScriptExtension
impl Default for ScriptExtension
source§impl Display for ScriptExtension
impl Display for ScriptExtension
source§impl From<&str> for ScriptExtension
impl From<&str> for ScriptExtension
source§impl From<Script> for ScriptExtension
impl From<Script> for ScriptExtension
source§impl From<char> for ScriptExtension
impl From<char> for ScriptExtension
source§impl Hash for ScriptExtension
impl Hash for ScriptExtension
source§impl PartialEq for ScriptExtension
impl PartialEq for ScriptExtension
source§fn eq(&self, other: &ScriptExtension) -> bool
fn eq(&self, other: &ScriptExtension) -> bool
self
and other
values to be equal, and is used
by ==
.