pub struct Modified<O, M> {
pub observable: O,
pub modifier: M,
}Expand description
An observable decorated with one correction — itself an observable, which is what makes the chain compose.
The sum is taken in application order. Floating-point addition is not associative, so the order a caller writes the chain in is the order it is summed in, and a chain reproduces a hand-written composition of the same terms in the same order to the bit.
Fields§
§observable: OThe decorated observable.
modifier: MThe correction applied to it.
Implementations§
Source§impl<O, M> Modified<O, M>
impl<O, M> Modified<O, M>
Sourcepub const fn with<N>(self, modifier: N) -> Modified<Self, N>
pub const fn with<N>(self, modifier: N) -> Modified<Self, N>
Add one more correction to the chain, applied after the ones already in it.
Chaining lives here rather than on Observable so that a chain can be built without
naming K: every observable and every modifier in this module is written for all K, so a
method on the trait would be ambiguous at the point it is called and would have to be
turbofished. Assembled this way, K is fixed once — where the chain meets the parameter
vector it is evaluated at.