# IApplicationLifetime

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/application_lifetimes/trait-iapplicationlifetime/

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

```rust
trait IApplicationLifetime
```

The lifetime of an application: the object that decides when the
application starts and ends and what its main view is.

The more specific lifetime contracts are reached through the `as_*`
methods, which a lifetime overrides for every contract it implements, or
through `as_any` for a concrete lifetime type.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L13)

## Members

- [`as_any`](#function-as_any)
- [`as_controlled_application_lifetime`](#function-as_controlled_application_lifetime)
- [`as_single_view_application_lifetime`](#function-as_single_view_application_lifetime)
- [`as_single_top_level_application_lifetime`](#function-as_single_top_level_application_lifetime)
- [`as_activity_application_lifetime`](#function-as_activity_application_lifetime)
- [`as_setup_application_lifetime`](#function-as_setup_application_lifetime)
- [`as_classic_desktop_style_application_lifetime`](#function-as_classic_desktop_style_application_lifetime)

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn Any
```

The lifetime as its concrete type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L15)

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

### as_controlled_application_lifetime

```rust
fn as_controlled_application_lifetime(self: &Self) -> Option<&dyn IControlledApplicationLifetime>
```

The lifetime as a controlled lifetime, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L18)

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

### as_single_view_application_lifetime

```rust
fn as_single_view_application_lifetime(self: &Self) -> Option<&dyn ISingleViewApplicationLifetime>
```

The lifetime as a single view lifetime, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L23)

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

### as_single_top_level_application_lifetime

```rust
fn as_single_top_level_application_lifetime(self: &Self) -> Option<&dyn super::ISingleTopLevelApplicationLifetime>
```

The lifetime as a single top-level lifetime, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L28)

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

### as_activity_application_lifetime

```rust
fn as_activity_application_lifetime(self: &Self) -> Option<&dyn IActivityApplicationLifetime>
```

The lifetime as an activity lifetime, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L33)

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

### as_setup_application_lifetime

```rust
fn as_setup_application_lifetime(self: &Self) -> Option<&dyn ISetupApplicationLifetime>
```

The lifetime as a lifetime that takes part in the setup of the
application, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L39)

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

### as_classic_desktop_style_application_lifetime

```rust
fn as_classic_desktop_style_application_lifetime(self: &Self) -> Option<&dyn super::IClassicDesktopStyleApplicationLifetime>
```

The lifetime as a classic desktop style lifetime, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/i_application_lifetime.rs#L44)

## Trait implementations

- [`IApplicationLifetime`](/docs/0.5.0/api/ferroui-controls/application_lifetimes/trait-iapplicationlifetime/)

## Availability

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