State Inspection

Before applying a change, you should understand the current state, and what the change will do.

To discover the current state of all items, Item::try_state_current is run for each item concurrently.

let graph = /* .. */;
let resources = /* .. */;

let resources = StatesDiscoverCmd::current(graph, resources).await?;

%3fn1fn1fn3fn3fn1->fn3fn2fn2fn2->fn3fn4fn4fn2->fn4fn3->fn4
// Item1::StateCurrentFn::try_exec
let exists = param1.path().exists();
Ok(State::new(exists, ()))

// Item2::StateCurrentFn::try_exec
let instance_url = discover(param2).await?;
Ok(State::new(Some(instance_url), ()))

// Item3::StateCurrentFn::try_exec
let version = reqwest::get(instance_url).await?;
Ok(State::new(version, ()))

// ..

When all states have been collected, they are presented to the user:

state1: exists
state2: 1.2.3.4
state3: 1.0.0
state4: abcdef0123456