vthread 0.1.0

Bounded carrier-affine virtual threads for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::RunFailure;
use crate::Error;

#[test]
fn dual_failure_preserves_owned_causes() {
    let failure = RunFailure::new(Error::Cancelled, Error::BlockingFailed);
    assert!(matches!(failure.scope(), Error::Cancelled));
    assert!(matches!(failure.shutdown(), Error::BlockingFailed));
    let (scope, shutdown) = failure.into_parts();
    assert!(matches!(scope, Error::Cancelled));
    assert!(matches!(shutdown, Error::BlockingFailed));
}