# ObservableSink

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/core/struct-observablesink/

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

```rust
struct ObservableSink
```

Adapts a binding expression to an observable subject: observers receive
the values of the expression, and values pushed into the subject are
written to the binding source.

This preserves the semantics of binding expressions as observed through
an observable (mostly for unit tests), not necessarily those of an
expression instantiated on an object. An expression may act either as an
observable or as a binding on an object, not both.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/untyped_binding_expression_base.rs#L646)

## Members

- [`create`](#function-create)
- [`expression`](#function-expression)
- [`on_next`](#function-on_next)

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

### create

```rust
fn create<E: UntypedBindingExpression>(expression: &Rc<E>, target: Option<&FerroObject>) -> Rc<ObservableSink>
```

Produces an observable which can be used to observe the value of
`expression`. Panics if the expression is already instantiated on an
object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/untyped_binding_expression_base.rs#L658)

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

### expression

```rust
fn expression(self: &Self) -> &Rc<dyn UntypedBindingExpression>
```

The expression behind the subject.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/untyped_binding_expression_base.rs#L684)

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

### on_next

```rust
fn on_next(self: &Self, value: Option<BoxedValue>)
```

Writes a value to the binding source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/untyped_binding_expression_base.rs#L689)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `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/)
- `ErasedDestructor`
- `IntoEither`
- [`IObservable<Option<Rc<dyn AnyValue>>>`](/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/).
