Skip to main content

first

Function first 

Source
pub fn first<A, B, Env, E1, E2>(
    e1: E1,
    e2: E2,
) -> BoxedEffect<A, AnalysisError, Env>
where A: Send + 'static, B: Send + 'static, Env: Clone + Send + Sync + 'static, E1: Effect<Output = A, Error = AnalysisError, Env = Env> + Send + 'static, E2: Effect<Output = B, Error = AnalysisError, Env = Env> + Send + 'static,
Expand description

Run the first effect, ignoring the second’s value.

This is useful when you need side effects from the second but only care about the first’s result.

§Example

let effect = first(compute_result(), log_completion());
// Returns compute_result's value, but log_completion runs too