go-spawn 0.1.2

a library that provides macros to spawn and join threads with minimal boilerplate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::any::Any;
use thiserror::Error;

pub type Result<T, E = JoinError> = std::result::Result<T, E>;

#[derive(Debug, Error)]
pub enum JoinError {
    /// Indicates that no thread was available to be joined.
    #[error("no thread was available to be joined")]
    NoHandleFound,

    /// Indicates that the joined thread panicked with the given value.
    #[error("the joined thread panicked before exiting normally")]
    ThreadPanic(Box<dyn Any + Send + 'static>),
}