yog 0.0.67

yog: the standalone server for litany loops — the world, the balls and the conversations, behind one wire
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! The composer's draft-clearing predicate — its own file at §12's per-file
//! budget (bl-40ab), on a real seam: a [`Reply`] is what the boundary answers,
//! and whether an answer *clears the draft that asked for it* is a question a
//! seat asks about one, not a property of the type.

use super::Reply;

/// Whether a dispatch outcome was clean — the draft-clearing predicate the
/// composer reads (§5.3: RAM until *sent*): a captured run must have exited 0;
/// any other reply is its action's success by construction; a refusal is not.
pub fn cleared(result: &Result<Reply, String>) -> bool {
    match result {
        Ok(Reply::Outcome(outcome)) => outcome.ok(),
        Ok(_) => true,
        Err(_) => false,
    }
}