# PropertyObservable

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

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

```rust
struct PropertyObservable<S: ?Sized + 'static, T: 'static>
```

The values of one property of an object that raises `PropertyChanged`: the current value on
subscription, then the value after each notification of the property or of every property
(`PropertyObservable<T>`).

A notification raised while a value is being delivered is delivered after it, with the value
read again; with `distinct_until_changed`, a value equal to the last one is dropped.

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

## Members

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

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

### new

```rust
fn new(source: &Rc<S>, property_name: impl Into<String>, getter: impl Fn(&Rc<S>) -> T + 'static, distinct_until_changed: bool) -> Self
where T: PartialEq
```

The values of `property_name` of `source`, read with `getter`.

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

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

### with_comparer

```rust
fn with_comparer(source: &Rc<S>, property_name: impl Into<String>, getter: impl Fn(&Rc<S>) -> T + 'static, comparer: Option<ValueComparer<T>>) -> Self
```

The values of `property_name` of `source`, dropping a value that `comparer` finds equal to
the last one.

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

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