Struct icu::properties::script::ScriptExtensionsSet
source · [−]pub struct ScriptExtensionsSet<'a> { /* private fields */ }
Expand description
A struct that wraps a Script
array, such as in the return value for
get_script_extensions_val()
.
Implementations
sourceimpl<'_> ScriptExtensionsSet<'_>
impl<'_> ScriptExtensionsSet<'_>
sourcepub fn contains(&self, x: &Script) -> bool
pub fn contains(&self, x: &Script) -> bool
Returns whether this set contains the given script.
Example
use icu::properties::{script, Script};
let data =
script::load_script_with_extensions_unstable(&icu_testdata::unstable())
.expect("The data should be valid");
let swe = data.as_borrowed();
assert!(swe
.get_script_extensions_val(0x11303) // GRANTHA SIGN VISARGA
.contains(&Script::Grantha));
sourcepub fn iter(&self) -> impl DoubleEndedIterator
pub fn iter(&self) -> impl DoubleEndedIterator
Gets an iterator over the elements.
Example
use icu::properties::{script, Script};
let data =
script::load_script_with_extensions_unstable(&icu_testdata::unstable())
.expect("The data should be valid");
let swe = data.as_borrowed();
assert_eq!(
swe.get_script_extensions_val('௫' as u32) // U+0BEB TAMIL DIGIT FIVE
.iter()
.collect::<Vec<Script>>(),
vec![Script::Tamil, Script::Grantha]
);
Trait Implementations
sourceimpl<'a> Clone for ScriptExtensionsSet<'a>
impl<'a> Clone for ScriptExtensionsSet<'a>
sourcefn clone(&self) -> ScriptExtensionsSet<'a>
fn clone(&self) -> ScriptExtensionsSet<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for ScriptExtensionsSet<'a>
impl<'a> Debug for ScriptExtensionsSet<'a>
sourceimpl<'a> PartialEq<ScriptExtensionsSet<'a>> for ScriptExtensionsSet<'a>
impl<'a> PartialEq<ScriptExtensionsSet<'a>> for ScriptExtensionsSet<'a>
sourcefn eq(&self, other: &ScriptExtensionsSet<'a>) -> bool
fn eq(&self, other: &ScriptExtensionsSet<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScriptExtensionsSet<'a>) -> bool
fn ne(&self, other: &ScriptExtensionsSet<'a>) -> bool
This method tests for !=
.
impl<'a> Copy for ScriptExtensionsSet<'a>
impl<'a> Eq for ScriptExtensionsSet<'a>
impl<'a> StructuralEq for ScriptExtensionsSet<'a>
impl<'a> StructuralPartialEq for ScriptExtensionsSet<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ScriptExtensionsSet<'a>
impl<'a> Send for ScriptExtensionsSet<'a>
impl<'a> Sync for ScriptExtensionsSet<'a>
impl<'a> Unpin for ScriptExtensionsSet<'a>
impl<'a> UnwindSafe for ScriptExtensionsSet<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more