pub fn max<A, B, T>(a: A, b: B) -> Map<Zip<A, B>, fn((T, T)) -> T, T>Expand description
Returns the maximum value between two Signal values.
This function takes two values implementing the Signal trait with the same output type
and returns a new computation that, when executed, will produce the maximum of the outputs
from the two input computations.
§Type Parameters
A: The first computation type that implementsSignal<Output = T>.B: The second computation type that implementsSignal<Output = T>.T: The output type that must implementOrdfor comparison.
§Constraints
- Both
AandBmust have the same output typeT. Tmust implementOrdto enable comparison operations.Tmust be'staticfor lifetime requirements.
§Returns
A new computation that will yield the maximum value between the outputs from computations a and b.
§Examples
let a: Binding<i32> = binding(10);
let b: Binding<i32> = binding(5);
let maximum = max(a, b);
assert_eq!(maximum.snapshot(), 10);