servlet 1.2.0

A small application runtime with an explicit operational contract
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! An embedded executor cannot accidentally claim process telemetry ownership.

use super::Bootstrap;
use crate::Error;

#[tokio::test]
async fn nesting_fails_before_polling_the_future() {
    let result: crate::Result<()> = Bootstrap::new().block_on(async {
        panic!("nested bootstrap must not poll the entry point");
    });
    assert!(matches!(result, Err(Error::Registration(_))));
}

#[test]
fn host_owned_bootstrap_does_not_require_a_subscriber() {
    let result: crate::Result<usize> = Bootstrap::new().host_telemetry().block_on(async { Ok(42) });
    assert_eq!(result.unwrap(), 42);
}