Skip to main content

WrittenUnit

Enum WrittenUnit 

Source
#[non_exhaustive]
pub enum WrittenUnit {
Show 101 variants A, Aa, Ah, Ai, At, B, B2, C, Cc, Ch, Cp, Cr, Cs, D, Db, Dd, Dh, Dp, Dt, E, F, G, G2, G3, G4, Gc, Gh, Gp, Gx, H, Hb, Hc, Hh, Hp, Hr, Hx, Hx2, I, I3, Ic, Ip, Ix, Iy, J, J2, Jb, Jc, K, K2, Kc, Kh, Kp, L, Lv, M, M2, Mvs, N, N2, Nirugu, Nx, Ny, O, Ob, Oh, Op, Ot, P, Pb, Pp, R, R2, R3, Rh, Rr, S, Sh, Sp, Sz, T, Tb, Th, Tp, Tt, U, Ue, Uh, Up, Ux, V, W, Wb, Y, Yp, Z, Zc, Zr, Zs, Zs2, Zwj, Zz,
}
Expand description

A written unit: an opaque glyph-form identifier produced by shaping (see docs/data-format.md). The structural tokens Mvs, Nirugu and Zwj are members too: they appear verbatim in Shaper::shape output, exactly as the Python implementation emits them.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

A

Written unit A.

§

Aa

Written unit Aa.

§

Ah

Written unit Ah.

§

Ai

Written unit Ai.

§

At

Written unit At.

§

B

Written unit B.

§

B2

Written unit B2.

§

C

Written unit C.

§

Cc

Written unit Cc.

§

Ch

Written unit Ch.

§

Cp

Written unit Cp.

§

Cr

Written unit Cr.

§

Cs

Written unit Cs.

§

D

Written unit D.

§

Db

Written unit Db.

§

Dd

Written unit Dd.

§

Dh

Written unit Dh.

§

Dp

Written unit Dp.

§

Dt

Written unit Dt.

§

E

Written unit E.

§

F

Written unit F.

§

G

Written unit G.

§

G2

Written unit G2.

§

G3

Written unit G3.

§

G4

Written unit G4.

§

Gc

Written unit Gc.

§

Gh

Written unit Gh.

§

Gp

Written unit Gp.

§

Gx

Written unit Gx.

§

H

Written unit H.

§

Hb

Written unit Hb.

§

Hc

Written unit Hc.

§

Hh

Written unit Hh.

§

Hp

Written unit Hp.

§

Hr

Written unit Hr.

§

Hx

Written unit Hx.

§

Hx2

Written unit Hx2.

§

I

Written unit I.

§

I3

Written unit I3.

§

Ic

Written unit Ic.

§

Ip

Written unit Ip.

§

Ix

Written unit Ix.

§

Iy

Written unit Iy.

§

J

Written unit J.

§

J2

Written unit J2.

§

Jb

Written unit Jb.

§

Jc

Written unit Jc.

§

K

Written unit K.

§

K2

Written unit K2.

§

Kc

Written unit Kc.

§

Kh

Written unit Kh.

§

Kp

Written unit Kp.

§

L

Written unit L.

§

Lv

Written unit Lv.

§

M

Written unit M.

§

M2

Written unit M2.

§

Mvs

Structural token: Mongolian vowel separator U+180E (NNBSP U+202F is folded into it).

§

N

Written unit N.

§

N2

Written unit N2.

§

Nirugu

Structural token: nirugu U+180A, the visible stem extender.

§

Nx

Written unit Nx.

§

Ny

Written unit Ny.

§

O

Written unit O.

§

Ob

Written unit Ob.

§

Oh

Written unit Oh.

§

Op

Written unit Op.

§

Ot

Written unit Ot.

§

P

Written unit P.

§

Pb

Written unit Pb.

§

Pp

Written unit Pp.

§

R

Written unit R.

§

R2

Written unit R2.

§

R3

Written unit R3.

§

Rh

Written unit Rh.

§

Rr

Written unit Rr.

§

S

Written unit S.

§

Sh

Written unit Sh.

§

Sp

Written unit Sp.

§

Sz

Written unit Sz.

§

T

Written unit T.

§

Tb

Written unit Tb.

§

Th

Written unit Th.

§

Tp

Written unit Tp.

§

Tt

Written unit Tt.

§

U

Written unit U.

§

Ue

Written unit Ue.

§

Uh

Written unit Uh.

§

Up

Written unit Up.

§

Ux

Written unit Ux.

§

V

Written unit V.

§

W

Written unit W.

§

Wb

Written unit Wb.

§

Y

Written unit Y.

§

Yp

Written unit Yp.

§

Z

Written unit Z.

§

Zc

Written unit Zc.

§

Zr

Written unit Zr.

§

Zs

Written unit Zs.

§

Zs2

Written unit Zs2.

§

Zwj

Structural token: zero width joiner U+200D.

§

Zz

Written unit Zz.

Implementations§

Source§

impl WrittenUnit

Source

pub const ALL: [WrittenUnit; 101]

Every variant, in declaration (sorted contract-name) order.

Source

pub const fn as_str(self) -> &'static str

The contract name used by the Python API, the CLI and the data files.

Source

pub const fn is_structural(self) -> bool

true for the structural tokens Mvs, Nirugu and Zwj.

Trait Implementations§

Source§

impl Clone for WrittenUnit

Source§

fn clone(&self) -> WrittenUnit

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WrittenUnit

Source§

impl Debug for WrittenUnit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for WrittenUnit

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WrittenUnit

Source§

impl FromStr for WrittenUnit

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(name: &str) -> Result<WrittenUnit, Error>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for WrittenUnit

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for WrittenUnit

Source§

fn cmp(&self, other: &WrittenUnit) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for WrittenUnit

Source§

fn eq(&self, other: &WrittenUnit) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for WrittenUnit

Source§

fn partial_cmp(&self, other: &WrittenUnit) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for WrittenUnit

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.