keyhog-sources 0.5.44

keyhog-sources: pluggable input backends for KeyHog (git, S3, GCS, Azure Blob, Docker, Web)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use keyhog_core::SourceError;

pub(crate) fn collect_on_blocking_thread<T, F>(source: &'static str, f: F) -> Result<T, SourceError>
where
    T: Send,
    F: FnOnce() -> Result<T, SourceError> + Send,
{
    std::thread::scope(|scope| match scope.spawn(f).join() {
        Ok(result) => result,
        Err(_panic) => Err(SourceError::Other(format!(
            "{source} fetch thread panicked"
        ))),
    })
}