# ServiceKey

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dependency-injection/struct-servicekey/

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

```rust
struct ServiceKey
```

An arbitrary value key, compared by type and value. `None` represents an unkeyed service.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_type.rs#L74)

## Members

- [`new`](#function-new)
- [`ANY`](#assoc_const-any)
- [`is_any`](#function-is_any)
- [`downcast_ref`](#function-downcast_ref)

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

### new

```rust
fn new<T: Eq + Hash + fmt::Debug + 'static>(value: T) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_type.rs#L76)

<a id="assoc_const-any"></a>

### ANY

```rust
const ANY: Self
```

Catch-all registration / query for all explicitly keyed registrations.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_type.rs#L80)

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

### is_any

```rust
fn is_any(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_type.rs#L81)

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

### downcast_ref

```rust
fn downcast_ref<T: 'static>(self: &Self) -> Option<&T>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_type.rs#L84)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `From<&str>`
- `From<String>`
- `PartialEq`
- `Eq`
- `Hash`
- `Debug`

## Availability

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