Skip to main content

Properties

Struct Properties 

Source
pub struct Properties(/* private fields */);
Expand description

Unicode character properties relevant for text analysis.

Implementations§

Source§

impl Properties

Source

pub fn get(ch: char) -> Self

Returns the properties for a given character.

Source

pub fn new( script: Script, gc: GeneralCategory, gcb: GraphemeClusterBreak, bidi: BidiClass, is_emoji_or_pictographic: bool, is_variation_selector: bool, is_region_indicator: bool, is_mandatory_linebreak: bool, ) -> Self

Creates a new Properties from the given properties

Source

pub fn script(&self) -> Script

Returns the script for the character.

Source

pub fn general_category(&self) -> GeneralCategory

Returns the general category for the character.

Source

pub fn grapheme_cluster_break(&self) -> GraphemeClusterBreak

Returns the grapheme cluster break for the character.

Source

pub fn bidi_class(&self) -> BidiClass

Returns the bidirectional class for the character.

Source

pub fn is_emoji_or_pictograph(&self) -> bool

Returns whether the character is an emoji or pictograph.

Source

pub fn is_variation_selector(&self) -> bool

Returns whether the character is a variation selector.

Source

pub fn is_region_indicator(&self) -> bool

Returns whether the character is a region indicator.

Source

pub fn is_mandatory_linebreak(&self) -> bool

Returns whether the character is a mandatory linebreak.

Trait Implementations§

Source§

impl Clone for Properties

Source§

fn clone(&self) -> Properties

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 Properties

Source§

impl Debug for Properties

Source§

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

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

impl From<Properties> for u32

Source§

fn from(value: Properties) -> Self

Converts to this type from the input type.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.