BidiAuxiliaryPropertiesBorrowed

Struct BidiAuxiliaryPropertiesBorrowed 

Source
pub struct BidiAuxiliaryPropertiesBorrowed<'a> { /* private fields */ }
Expand description

A borrowed wrapper around Bidi properties data, returned by BidiAuxiliaryProperties::as_borrowed(). More efficient to query.

Implementations§

Source§

impl<'a> BidiAuxiliaryPropertiesBorrowed<'a>

Source

pub fn get32_mirroring_props(&self, code_point: u32) -> BidiMirroringProperties

Return a struct for the given code point representing Bidi mirroring-related property values. See BidiMirroringProperties.

§Examples
use icu::properties::bidi_data;

let bidi_data = bidi_data::bidi_auxiliary_properties();

let open_paren = bidi_data.get32_mirroring_props('(' as u32);
assert_eq!(open_paren.mirroring_glyph, Some(')'));
assert_eq!(open_paren.mirrored, true);
let close_paren = bidi_data.get32_mirroring_props(')' as u32);
assert_eq!(close_paren.mirroring_glyph, Some('('));
assert_eq!(close_paren.mirrored, true);
let open_angle_bracket = bidi_data.get32_mirroring_props('<' as u32);
assert_eq!(open_angle_bracket.mirroring_glyph, Some('>'));
assert_eq!(open_angle_bracket.mirrored, true);
let close_angle_bracket = bidi_data.get32_mirroring_props('>' as u32);
assert_eq!(close_angle_bracket.mirroring_glyph, Some('<'));
assert_eq!(close_angle_bracket.mirrored, true);
let three = bidi_data.get32_mirroring_props('3' as u32);
assert_eq!(three.mirroring_glyph, None);
assert_eq!(three.mirrored, false);
Source

pub fn get32_pairing_props(&self, code_point: u32) -> BidiPairingProperties

Return a struct for the given code point representing Bidi bracket pairing-related property values. See BidiPairingProperties

§Examples
use icu::properties::{bidi_data, bidi_data::BidiPairingProperties};

let bidi_data = bidi_data::bidi_auxiliary_properties();

let open_paren = bidi_data.get32_pairing_props('(' as u32);
assert_eq!(open_paren, BidiPairingProperties::Open(')'));
let close_paren = bidi_data.get32_pairing_props(')' as u32);
assert_eq!(close_paren, BidiPairingProperties::Close('('));
let open_angle_bracket = bidi_data.get32_pairing_props('<' as u32);
assert_eq!(open_angle_bracket, BidiPairingProperties::None);
let close_angle_bracket = bidi_data.get32_pairing_props('>' as u32);
assert_eq!(close_angle_bracket, BidiPairingProperties::None);
let three = bidi_data.get32_pairing_props('3' as u32);
assert_eq!(three, BidiPairingProperties::None);
Source§

impl BidiAuxiliaryPropertiesBorrowed<'static>

Source

pub const fn static_to_owned(self) -> BidiAuxiliaryProperties

Cheaply converts a BidiAuxiliaryPropertiesBorrowed<'static> into a BidiAuxiliaryProperties.

Note: Due to branching and indirection, using BidiAuxiliaryProperties might inhibit some compile-time optimizations that are possible with BidiAuxiliaryPropertiesBorrowed.

Trait Implementations§

Source§

impl<'a> Debug for BidiAuxiliaryPropertiesBorrowed<'a>

Source§

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

Formats the value using the given formatter. Read more

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> 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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 8 bytes