Struct ScriptWithExtensionsBorrowed
struct ScriptWithExtensionsBorrowed<'a> { ... }
A borrowed wrapper around script extension data, returned by
[ScriptWithExtensions::as_borrowed()]. More efficient to query.
Implementations
impl ScriptWithExtensionsBorrowed<'static>
fn new() -> SelfCreates a new instance of
ScriptWithExtensionsBorrowedusing compiled data.✨ Enabled with the
compiled_dataCargo feature.const fn static_to_owned(self: Self) -> ScriptWithExtensionsCheaply converts a [
ScriptWithExtensionsBorrowed<'static>] into aScriptWithExtensions.Note: Due to branching and indirection, using
ScriptWithExtensionsmight inhibit some compile-time optimizations that are possible withScriptWithExtensionsBorrowed.
impl<'a> ScriptWithExtensionsBorrowed<'a>
fn get_script_val(self: Self, ch: char) -> ScriptReturns the
Scriptproperty value for this code point.Examples
use ScriptWithExtensions; use Script; let swe = new; // U+0640 ARABIC TATWEEL assert_eq!; // main Script value assert_ne!; assert_ne!; assert_ne!; // U+0650 ARABIC KASRA assert_eq!; // main Script value assert_ne!; assert_ne!; assert_ne!; // U+0660 ARABIC-INDIC DIGIT ZERO assert_ne!; assert_eq!; // main Script value assert_ne!; assert_ne!; // U+FDF2 ARABIC LIGATURE ALLAH ISOLATED FORM assert_ne!; assert_eq!; // main Script value assert_ne!; assert_ne!;fn get_script_val32(self: Self, code_point: u32) -> ScriptSee
Self::get_script_val.fn get_script_extensions_val(self: Self, ch: char) -> ScriptExtensionsSet<'a>Return the
Script_Extensionsproperty value for this code point.If
code_pointhas Script_Extensions, then return the Script codes in the Script_Extensions. In this case, the Script property value (normally Common or Inherited) is not included in theScriptExtensionsSet.If c does not have Script_Extensions, then the one Script code is put into the
ScriptExtensionsSetand also returned.If c is not a valid code point, then return an empty
ScriptExtensionsSet.Examples
use ScriptWithExtensions; use Script; let swe = new; assert_eq!; assert_eq!; assert_eq!; assert_eq!;fn get_script_extensions_val32(self: Self, code_point: u32) -> ScriptExtensionsSet<'a>fn has_script(self: Self, ch: char, script: Script) -> boolReturns whether
scriptis contained in the Script_Extensions property value if the code_point has Script_Extensions, otherwise if the code point does not have Script_Extensions then returns whether the Script property value matches.Some characters are commonly used in multiple scripts. For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
Examples
use ScriptWithExtensions; use Script; let swe = new; // U+0650 ARABIC KASRA assert!; // main Script value assert!; assert!; assert!; // U+0660 ARABIC-INDIC DIGIT ZERO assert!; // main Script value assert!; assert!; assert!; // U+FDF2 ARABIC LIGATURE ALLAH ISOLATED FORM assert!; assert!; // main Script value assert!; assert!;fn has_script32(self: Self, code_point: u32, script: Script) -> boolSee
Self::has_script.fn get_script_extensions_ranges(self: Self, script: Script) -> impl Iterator<Item = RangeInclusive<u32>> + 'aReturns all of the matching
CodePointMapRanges for the givenScriptin whichhas_scriptwill return true for all of the contained code points.Examples
use Script; use ScriptWithExtensions; let swe = new; let syriac_script_extensions_ranges = swe.get_script_extensions_ranges; let exp_ranges = ; assert_eq!;
impl Default for ScriptWithExtensionsBorrowed<'static>
fn default() -> Self
impl<'a> Clone for ScriptWithExtensionsBorrowed<'a>
fn clone(self: &Self) -> ScriptWithExtensionsBorrowed<'a>
impl<'a> Copy for ScriptWithExtensionsBorrowed<'a>
impl<'a> Debug for ScriptWithExtensionsBorrowed<'a>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'a> Freeze for ScriptWithExtensionsBorrowed<'a>
impl<'a> RefUnwindSafe for ScriptWithExtensionsBorrowed<'a>
impl<'a> Send for ScriptWithExtensionsBorrowed<'a>
impl<'a> Sync for ScriptWithExtensionsBorrowed<'a>
impl<'a> Unpin for ScriptWithExtensionsBorrowed<'a>
impl<'a> UnsafeUnpin for ScriptWithExtensionsBorrowed<'a>
impl<'a> UnwindSafe for ScriptWithExtensionsBorrowed<'a>
impl<T> Any for ScriptWithExtensionsBorrowed<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ScriptWithExtensionsBorrowed<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ScriptWithExtensionsBorrowed<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ScriptWithExtensionsBorrowed<'a>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for ScriptWithExtensionsBorrowed<'a>
impl<T> From for ScriptWithExtensionsBorrowed<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ScriptWithExtensionsBorrowed<'a>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for ScriptWithExtensionsBorrowed<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ScriptWithExtensionsBorrowed<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ScriptWithExtensionsBorrowed<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>