NSStringCompareOptions

Enum NSStringCompareOptions 

Source
#[repr(u64)]
pub enum NSStringCompareOptions { CaseInsensitive = 1, Literal = 2, Backwards = 4, Anchored = 8, Numeric = 64, DiacriticInsensitive = 128, WidthInsensitive = 256, ForcedOrdering = 512, RegularExpression = 1_024, }
Expand description

These values represent the options available to many of the string classes’ search and comparison methods.

Variants§

§

CaseInsensitive = 1

A case-insensitive search.

§

Literal = 2

Exact character-by-character equivalence.

§

Backwards = 4

Search from end of source string.

§

Anchored = 8

Search is limited to start (or end, if NSBackwardsSearch) of source string.

§

Numeric = 64

Numbers within strings are compared using numeric value, that is, Name2.txt < Name7.txt < Name25.txt.

§

DiacriticInsensitive = 128

Search ignores diacritic marks.

§

WidthInsensitive = 256

Search ignores width differences in characters that have full-width and half-width forms, as occurs in East Asian character sets.

§

ForcedOrdering = 512

Comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal.

§

RegularExpression = 1_024

The search string is treated as an ICU-compatible regular expression. If set, no other options can apply except caseInsensitive and anchored. You can use this option only with the rangeOfString:… methods and replacingOccurrences(of:with:options:range:).

Implementations§

Source§

impl NSStringCompareOptions

Source

pub fn new(raw_value: usize) -> Self

Creates a new CompareOptions with the given flags.

Trait Implementations§

Source§

impl Debug for NSStringCompareOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for NSStringCompareOptions

Source§

fn eq(&self, other: &NSStringCompareOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for NSStringCompareOptions

Source§

impl StructuralPartialEq for NSStringCompareOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.