wlan_hw_sim::event

Function once

Source
pub fn once<S, E, T, F>(f: F) -> impl Handler<S, E, Output = T>
where F: FnOnce(&mut S, &E) -> T,
Expand description

Constructs an event handler from a FnOnce that only executes once.

The event handler executes the given function upon receiving its first call and always matches the event. After this occurs, the function has been consumed and the adapter always returns Handled::Unmatched.