# shrinkage::SolverObserver

Shrinkage for Rust · 0.3.0

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/observer.rs>)

```rust
pub trait SolverObserver
```

A read-only consumer of solver states. 

Closures accepting [`SolverStep`](<b7ec2aba327520fb49c0cb84e9d6057c20cbdbe2607580f095913a512daf2171>) implement this trait. Copy any parameters that must outlive a callback. Observers cannot alter stopping or acceptance. 

<a id="methods"></a>

## Methods

<a id="method-observe"></a>

### `observe`

```rust
fn observe(&mut self, step: SolverStep<'_>)
```

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/observer.rs>)

Observe initialization, an accepted update, or the final state. 

<a id="method-observe_inner"></a>

### `observe_inner`

```rust
fn observe_inner(&mut self, _step: SolverStep<'_>, _outer_iteration: usize)
```

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/observer.rs>)

Observe an update inside an outer iteration. 

These states solve a surrogate or a block restriction. They need not decrease the original objective or become an accepted outer state. The default ignores them, including for closure observers. `outer_iteration` identifies the parent IRLS update or hybrid sweep.
