# IdleTimeoutObservable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/platform/struct-idletimeoutobservable/

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

```rust
struct IdleTimeoutObservable
```

An idle timer that restarts on each deactivation (`IdleTimeoutObservable`): it notifies once
each time the application stays deactivated for the idle timeout without being reactivated.
Each deactivation starts the timer again, a reactivation cancels it, and when it elapses it
notifies an empty disposable. It replaces
`deactivated.SelectMany(_ => Timer(idle)).TakeUntil(reactivated).Repeat()`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/platform/idle_timeout_observable.rs#L16)

## Members

- [`new`](#function-new)

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

### new

```rust
fn new(deactivated: Rc<dyn IObservable<()>>, reactivated: Rc<dyn IObservable<()>>, idle_timeout: impl Fn() -> Duration + 'static, scheduler: Rc<dyn IScheduler>) -> Rc<Self>
```

The idle timer of the application (`IdleTimeoutObservable(IObservable<RxVoid>,
IObservable<RxVoid>, Func<TimeSpan>, ISequencer)`): `idle_timeout` is read each time the
timer starts, and the timer runs on `scheduler`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/platform/idle_timeout_observable.rs#L27)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`SubscribeGuard<T>`](/docs/0.5.0/api/ferroui-base/reactive/use-subscribeguard/)
- [`IObservable<Rc<dyn IDisposable>>`](/docs/0.5.0/api/ferroui-base/reactive/use-iobservable/)

## Availability

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