Function wlan_hw_sim::event::map_state

source ·
pub fn map_state<H, S1, S2, E, F>(
    f: F,
    handler: H
) -> impl Handler<S1, E, Output = H::Output>
where H: Handler<S2, E>, F: FnMut(&mut S1) -> S2,
Expand description

Maps the state passed to the constructed handler and forwards the mapped state to its composed handler.

This function constructs a handler that maps the state it receives and passes the resulting state to its composed handler. The mapping function can produce arbitrary state for the composed handler.