# CompareInfo

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-compareinfo/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct CompareInfo
```

Implements a set of methods for culture-sensitive string comparisons:
the comparer of a culture.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L135)

## Members

- [`invariant`](#function-invariant)
- [`name`](#function-name)
- [`compare`](#function-compare)
- [`is_prefix`](#function-is_prefix)
- [`index_of`](#function-index_of)
- [`to_upper_ordinal`](#function-to_upper_ordinal)

<a id="function-invariant"></a>

### invariant

```rust
fn invariant() -> CompareInfo
```

The comparer of the invariant culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L143)

<a id="function-name"></a>

### name

```rust
fn name(self: &Self) -> &str
```

The name of the culture used for the comparisons.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L148)

<a id="function-compare"></a>

### compare

```rust
fn compare(self: &Self, a: &str, b: &str, options: CompareOptions) -> Ordering
```

Compares two strings using the specified options.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L153)

<a id="function-is_prefix"></a>

### is_prefix

```rust
fn is_prefix(self: &Self, source: &str, prefix: &str, options: CompareOptions) -> bool
```

Determines whether `source` starts with `prefix` using the specified
options.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L165)

<a id="function-index_of"></a>

### index_of

```rust
fn index_of(self: &Self, source: &str, value: &str, options: CompareOptions) -> i32
```

Searches for `value` in `source` using the specified options and
returns the position of its first occurrence in UTF-16 code units,
or -1. An empty value is found at 0.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L179)

<a id="function-to_upper_ordinal"></a>

### to_upper_ordinal

```rust
fn to_upper_ordinal(c: char) -> char
```

The upper-case form of a character under the invariant simple case
mapping, the mapping of the ordinal comparison that ignores case: one
character maps to one character (no expansions: `ß` stays `ß`), no
culture is involved, and the dotless `ı` (U+0131) and the long `ſ`
(U+017F) keep their identity, as in the reference runtime.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L213)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
