Skip to main content

answered_within

Function answered_within 

Source
fn answered_within<T: Send + 'static>(
    timeout: Duration,
    what: &str,
    f: impl FnOnce() -> Result<T, String> + Send + 'static,
) -> Result<T, String>
Expand description

Run f on a thread of its own and wait at most timeout for its answer. A call into a driver library that never returns then costs a bounded wait and a leaked thread instead of the caller, whose name what gives the refusal.