# CallbackPropertyObservable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/observables/struct-callbackpropertyobservable/

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

```rust
struct CallbackPropertyObservable<S: 'static, V: 'static>
```

Observes a property through a change callback of its own: the value on subscription, then the
value each time the callback runs (`CallbackPropertyObservable<TSource, TValue>`).

An observer of a native mechanism (a property of a FerroUI object, a platform event) passes
what attaches to its notification as `subscribe`. The sequence never completes. Disposing a
subscription detaches it once, however many times it is disposed.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/observables/callback_property_observable.rs#L19)

## Members

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

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

### new

```rust
fn new(source: S, subscribe: impl Fn(&S, Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable> + 'static, getter: impl Fn(&S) -> V + 'static, distinct: bool) -> Self
where V: PartialEq
```

The values of `getter` on `source`, read again each time the callback that `subscribe`
attaches runs; with `distinct`, a value equal to the last one is dropped.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/observables/callback_property_observable.rs#L29)

## 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<V>`](/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/).
