camber 0.2.1

Opinionated async Rust for IO-bound services on top of Tokio
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use camber::RuntimeError;

#[test]
fn channel_send_after_receiver_drop_returns_error() {
    let (tx, rx) = camber::channel::new::<i32>();
    drop(rx);
    let result = tx.send(42);
    assert!(result.is_err());
    match result.unwrap_err() {
        RuntimeError::ChannelClosed => {}
        other => panic!("expected ChannelClosed, got: {other}"),
    }
}