swash::text

Trait Codepoint

Source
pub trait Codepoint: Sized + Copy {
Show 19 methods // Required methods fn properties(self) -> Properties; fn bracket_type(self) -> BracketType; fn opening_bracket(self) -> Option<char>; fn closing_bracket(self) -> Option<char>; fn mirror(self) -> Option<char>; fn compose(a: char, b: char) -> Option<char>; fn decompose(self) -> Decompose ; fn decompose_compatible(self) -> Decompose ; // Provided methods fn category(self) -> Category { ... } fn block(self) -> Block { ... } fn script(self) -> Script { ... } fn combining_class(self) -> u8 { ... } fn bidi_class(self) -> BidiClass { ... } fn joining_type(self) -> JoiningType { ... } fn cluster_break(self) -> ClusterBreak { ... } fn word_break(self) -> WordBreak { ... } fn line_break(self) -> LineBreak { ... } fn is_emoji(self) -> bool { ... } fn is_extended_pictographic(self) -> bool { ... }
}
Expand description

Trait that exposes Unicode properties for the char type.

Required Methods§

Source

fn properties(self) -> Properties

Returns the codepoint properties.

Source

fn bracket_type(self) -> BracketType

Returns the bracket type of the character.

Source

fn opening_bracket(self) -> Option<char>

If the character is a closing bracket, returns its opening bracket pair.

Source

fn closing_bracket(self) -> Option<char>

If the character is an opening bracket, returns its closing bracket pair.

Source

fn mirror(self) -> Option<char>

Returns the mirror of the character, if any.

Source

fn compose(a: char, b: char) -> Option<char>

Returns the composition of two characters, if any.

Source

fn decompose(self) -> Decompose

Returns the canonical decomposition of the character.

Source

fn decompose_compatible(self) -> Decompose

Returns the compatibility decomposition of the character.

Provided Methods§

Source

fn category(self) -> Category

Returns the category of the character.

Source

fn block(self) -> Block

Returns the unicode block that contains the character.

Source

fn script(self) -> Script

Returns the script to which the character belongs.

Source

fn combining_class(self) -> u8

Returns the canonical combining class of the character.

Source

fn bidi_class(self) -> BidiClass

Returns the bidirectional type of the character.

Source

fn joining_type(self) -> JoiningType

Returns the joining type of the character.

Source

fn cluster_break(self) -> ClusterBreak

Returns the cluster break property for the character.

Source

fn word_break(self) -> WordBreak

Returns the word break property for the character.

Source

fn line_break(self) -> LineBreak

Returns the line break property for the character.

Source

fn is_emoji(self) -> bool

Returns true if the character is an emoji.

Source

fn is_extended_pictographic(self) -> bool

Returns true if the character is an extended pictographic symbol.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Codepoint for char

Implementors§