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, bidi_data::BidiMirroringProperties};

let data = bidi_data::load_bidi_auxiliary_properties_unstable(
    &icu_testdata::unstable(),
)
.expect("The data should be valid");
let bidi_data = data.as_borrowed();

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 data = bidi_data::load_bidi_auxiliary_properties_unstable(
    &icu_testdata::unstable(),
)
.expect("The data should be valid");
let bidi_data = data.as_borrowed();

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);

Trait Implementations§

source§

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

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

source§

impl<T> MaybeSendSync for T