pub struct BidiAuxiliaryPropertiesBorrowed<'a> {
data: &'a BidiAuxiliaryPropertiesV1<'a>,
}
Expand description
A borrowed wrapper around Bidi properties data, returned by
BidiAuxiliaryProperties::as_borrowed()
. More efficient to query.
Fields§
§data: &'a BidiAuxiliaryPropertiesV1<'a>
Implementations§
source§impl<'a> BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> BidiAuxiliaryPropertiesBorrowed<'a>
fn convert_mirroring_glyph_data(trie_data_char: char) -> Option<char>
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;
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);
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 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>
impl BidiAuxiliaryPropertiesBorrowed<'static>
sourcepub const fn static_to_owned(self) -> BidiAuxiliaryProperties
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§
Auto Trait Implementations§
impl<'a> Freeze for BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> RefUnwindSafe for BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> Send for BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> Sync for BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> Unpin for BidiAuxiliaryPropertiesBorrowed<'a>
impl<'a> UnwindSafe for BidiAuxiliaryPropertiesBorrowed<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more