Struct icu::properties::bidi_data::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>
impl<'a> BidiAuxiliaryPropertiesBorrowed<'a>
sourcepub fn get32_mirroring_props(&self, code_point: u32) -> BidiMirroringProperties
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);
sourcepub fn get32_pairing_props(&self, code_point: u32) -> BidiPairingProperties
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);