# UriExtensions

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

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

```rust
struct UriExtensions
```

Helpers for the URIs that identify assets: absolute ones are `url::Url`,
references that may be relative [`UriRef`](/docs/0.5.0/api/ferroui-base/utilities/enum-uriref/) (C5 of #423).

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

## Members

- [`is_absolute_resm`](#function-is_absolute_resm)
- [`is_resm`](#function-is_resm)
- [`is_asset`](#function-is_asset)
- [`is_font_collection`](#function-is_font_collection)
- [`ensure_absolute`](#function-ensure_absolute)
- [`authority`](#function-authority)
- [`get_unescape_absolute_path`](#function-get_unescape_absolute_path)
- [`get_unescape_absolute_uri`](#function-get_unescape_absolute_uri)
- [`get_assembly_name_from_query`](#function-get_assembly_name_from_query)
- [`unescape_data_string`](#function-unescape_data_string)

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

### is_absolute_resm

```rust
fn is_absolute_resm(uri: &UriRef) -> bool
```

Whether the reference is an absolute embedded-resource URL.

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

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

### is_resm

```rust
fn is_resm(uri: &url::Url) -> bool
```

Whether the URL has the embedded-resource scheme.

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

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

### is_asset

```rust
fn is_asset(uri: &url::Url) -> bool
```

Whether the URL has the asset scheme (`ASSET_SCHEME`).

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

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

### is_font_collection

```rust
fn is_font_collection(uri: &url::Url) -> bool
```

Whether the URL names a font collection (`fonts:` scheme).

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

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

### ensure_absolute

```rust
fn ensure_absolute(uri: &UriRef, base_uri: Option<&url::Url>) -> Result<url::Url, FormatError>
```

Makes a relative reference absolute using `base_uri`, with
`UriRef::resolve`; an absolute reference is its URL. Fails when the
reference is relative and `base_uri` is missing, or when the reference
does not resolve to a URL.

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

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

### authority

```rust
fn authority(uri: &url::Url) -> &str
```

The authority (host) of a URL, or an empty string when it has none.

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

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

### get_unescape_absolute_path

```rust
fn get_unescape_absolute_path(uri: &url::Url) -> String
```

The unescaped path of a URL.

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

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

### get_unescape_absolute_uri

```rust
fn get_unescape_absolute_uri(uri: &url::Url) -> String
```

The unescaped text of a URL.

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

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

### get_assembly_name_from_query

```rust
fn get_assembly_name_from_query(uri: &url::Url) -> String
```

The value of the `assembly` parameter of the query of a URL, or an
empty string.

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

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

### unescape_data_string

```rust
fn unescape_data_string(s: &str) -> String
```

Converts the percent-encoded sequences of a string to the characters
they represent. Sequences that do not form valid UTF-8 are left as
they are.

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

## Trait implementations

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

## Availability

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