# ServiceType

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-splat/service_location/struct-servicetype/

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

```rust
struct ServiceType
```

The type of a service, the key of its registrations (the `Type` of a registration upstream,
`typeof(T)` of the generic forms).

It is the `TypeId` of the service type, which may be unsized (`dyn IViewLocator`), with the
name of the type for messages. Two values are equal when their types are.

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

## Members

- [`of`](#function-of)
- [`id`](#function-id)
- [`name`](#function-name)

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

### of

```rust
fn of<S: ?Sized + 'static>() -> Self
```

The service type `S`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/service_type.rs#L22)

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

### id

```rust
fn id(self: &Self) -> TypeId
```

The identifier of the type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/service_type.rs#L27)

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

### name

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

The name of the type, as `std::any::type_name` gives it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/service_type.rs#L32)

## 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`
- `Copy`
- `PartialEq`
- `Eq`
- `Hash`
- `Debug`

## Availability

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