posthog-rs 0.7.0

The official Rust client for Posthog (https://posthog.com/).
Documentation
#[cfg(all(feature = "e2e-test", feature = "async-client"))]
#[tokio::test]
async fn get_client_async() {
    use dotenv::dotenv;
    dotenv().ok(); // Load the .env file

    // see https://us.posthog.com/project/115809/ for the e2e project
    use posthog_rs::Event;
    use std::collections::HashMap;

    let api_key = match std::env::var("POSTHOG_RS_E2E_TEST_API_KEY") {
        Ok(key) if !key.is_empty() => key,
        _ => {
            eprintln!("Skipping e2e test: POSTHOG_RS_E2E_TEST_API_KEY not set");
            return;
        }
    };
    let client = posthog_rs::client(api_key.as_str()).await;

    let mut child_map = HashMap::new();
    child_map.insert("child_key1", "child_value1");

    let mut event = Event::new("e2e test event", "1234");
    event.insert_prop("key1", "value1").unwrap();
    event.insert_prop("key2", vec!["a", "b"]).unwrap();
    event.insert_prop("key3", child_map).unwrap();

    client.capture(event).await.unwrap();
}

#[cfg(all(feature = "e2e-test", not(feature = "async-client")))]
#[test]
fn get_client_blocking() {
    use dotenv::dotenv;
    dotenv().ok(); // Load the .env file

    // see https://us.posthog.com/project/115809/ for the e2e project
    use posthog_rs::Event;
    use std::collections::HashMap;

    let api_key = match std::env::var("POSTHOG_RS_E2E_TEST_API_KEY") {
        Ok(key) if !key.is_empty() => key,
        _ => {
            eprintln!("Skipping e2e test: POSTHOG_RS_E2E_TEST_API_KEY not set");
            return;
        }
    };
    let client = posthog_rs::client(api_key.as_str());

    let mut child_map = HashMap::new();
    child_map.insert("child_key1", "child_value1");

    let mut event = Event::new("e2e test event", "1234");
    event.insert_prop("key1", "value1").unwrap();
    event.insert_prop("key2", vec!["a", "b"]).unwrap();
    event.insert_prop("key3", child_map).unwrap();

    client.capture(event).unwrap();
}