[][src]Struct unicode_script::ScriptExtension

#[non_exhaustive]
pub struct ScriptExtension { /* fields omitted */ }

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

Methods

impl ScriptExtension[src]

pub const fn is_common(self) -> bool[src]

Checks if the script extension is Common

pub const fn is_inherited(self) -> bool[src]

Checks if the script extension is Inherited

pub const fn is_empty(self) -> bool[src]

Checks if the script extension is empty (unknown)

pub fn intersect_with(&mut self, other: Self)[src]

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

pub const fn intersection(self, other: Self) -> Self[src]

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

pub const fn union(self, other: Self) -> Self[src]

Find the union between two ScriptExtensions.

"Common" (Zyyy) and "Inherited" (Zinh) are considered as intersecting everything, the union of Common and Inherited is Common

pub fn contains_script(self, script: Script) -> bool[src]

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

pub fn for_str(x: &str) -> Self[src]

Get the intersection of script extensions of all characters in a string.

Important traits for ScriptIterator
pub fn iter(self) -> ScriptIterator[src]

Iterate over the scripts in this string

Will never yeild Script::Unknown

Trait Implementations

impl Clone for ScriptExtension[src]

impl Copy for ScriptExtension[src]

impl Debug for ScriptExtension[src]

impl Default for ScriptExtension[src]

impl Eq for ScriptExtension[src]

impl<'_> From<&'_ str> for ScriptExtension[src]

impl From<Script> for ScriptExtension[src]

impl From<char> for ScriptExtension[src]

impl Hash for ScriptExtension[src]

impl PartialEq<ScriptExtension> for ScriptExtension[src]

impl StructuralEq for ScriptExtension[src]

impl StructuralPartialEq for ScriptExtension[src]

impl TryFrom<ScriptExtension> for Script[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.