# ObservableExt

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/reactive/trait-observableext/

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

```rust
trait ObservableExt<T: 'static>
```

Operators available on every shared observable.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L133)

## Members

- [`subscribe_fn`](#function-subscribe_fn)
- [`subscribe_fn_guard`](#function-subscribe_fn_guard)
- [`select`](#function-select)
- [`where_`](#function-where_)
- [`start_with`](#function-start_with)
- [`combine_latest`](#function-combine_latest)
- [`skip`](#function-skip)
- [`take`](#function-take)

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

### subscribe_fn

```rust
fn subscribe_fn(self: &Self, on_next: impl Fn(T) -> () + 'static) -> Rc<dyn IDisposable>
```

Subscribes with a closure invoked for every value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L135)

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

### subscribe_fn_guard

```rust
fn subscribe_fn_guard(self: &Self, on_next: impl Fn(T) -> () + 'static) -> Subscription
```

Subscribes with a closure invoked for every value and returns the guard of the
subscription: dropping it unsubscribes (`subscribe_fn` returns the
handle, which keeps the subscription when it is dropped).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L140)

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

### select

```rust
fn select<U: 'static>(self: &Self, f: impl Fn(T) -> U + 'static) -> Rc<dyn IObservable<U>>
```

Projects each value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L145)

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

### where_

```rust
fn where_(self: &Self, f: impl Fn(&T) -> bool + 'static) -> Rc<dyn IObservable<T>>
```

Filters values.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L148)

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

### start_with

```rust
fn start_with(self: &Self, value: T) -> Rc<dyn IObservable<T>>
where T: Clone
```

Produces `value` to each observer before the values of the source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L151)

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

### combine_latest

```rust
fn combine_latest<TSecond: Clone + 'static, TResult: 'static>(self: &Self, second: &Rc<dyn IObservable<TSecond>>, result_selector: impl Fn(T, TSecond) -> TResult + 'static) -> Rc<dyn IObservable<TResult>>
where T: Clone
```

Combines the latest values of this observable and `second` with
`result_selector`, once both have produced a value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L157)

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

### skip

```rust
fn skip(self: &Self, skip_count: i32) -> Rc<dyn IObservable<T>>
```

Leaves out the first `skip_count` values.

Panics when `skip_count` is not bigger than zero.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L168)

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

### take

```rust
fn take(self: &Self, take_count: i32) -> Rc<dyn IObservable<T>>
```

Produces the first `take_count` values and completes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/observable.rs#L171)

## Trait implementations

- [`ObservableExt<T>`](/docs/0.5.0/api/ferroui-base/reactive/trait-observableext/)

## Availability

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