compose
Combines two functions into one that applies inner first and outer to its result:
compose(outer, inner)(x) is outer(inner(x)), like the mathematical outer ∘ inner.
See pipe for the same thing written in reading order.
Import
Section titled “Import”Cargo feature function (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
outer | impl Fn(B) -> C | The function applied last. |
inner | impl Fn(A) -> B | The function applied first. |
Returns
Section titled “Returns”impl Fn(A) -> C — A function from the input of inner to the output of outer.
