little-durable-objects 0.1.24

Standalone regional durable-object control plane, host, and durability runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use anyhow::Result;
use little_durable_objects::state_log::StateSnapshot;
use serde_json::json;

#[test]
fn immutable_snapshot_round_trips_state_and_result() -> Result<()> {
    let snapshot = StateSnapshot::new(7, 3, "request-7".into(), json!({ "count": 7 }), json!(7))?;

    let decoded = StateSnapshot::decode(&snapshot.encode()?)?;

    assert_eq!(decoded, snapshot);
    Ok(())
}