pub struct Frontdoor { /* private fields */ }Expand description
The directory of inbound requests.
Implementations§
Source§impl Frontdoor
impl Frontdoor
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Sourcepub fn open_default() -> Result<Self>
pub fn open_default() -> Result<Self>
~/.mecha/requests, where the drain writes.
pub fn root(&self) -> &Path
pub fn records(&self) -> Result<Vec<Record>>
pub fn record(&self, seq: i64) -> Result<Record>
Sourcepub fn reconcile(&self, outbox: &OutboxStore) -> Result<Vec<Transition>>
pub fn reconcile(&self, outbox: &OutboxStore) -> Result<Vec<Transition>>
Advance anything whose draft has since been released or rejected.
The outbox is the truth about a draft, and this store is the truth
about a request. Neither writes into the other; this reads the first
and updates the second, which is why releasing a draft with
mecha outbox send — a different process, hours later, knowing nothing
about requests — still closes the loop. The alternative was a callback
from the outbox, which would have made every sink in the system learn
what a request is.
Called before list and next rather than only on demand: a state
that is only correct after you remember to run a verb is a state nobody
can trust, and the whole point of awaiting_me is that it answers
“what is on me right now”.