pub struct Board { /* private fields */ }Implementations§
Source§impl Board
impl Board
Sourcepub fn open(path: &Path, run_id: &str) -> Result<Self, BoardError>
pub fn open(path: &Path, run_id: &str) -> Result<Self, BoardError>
Opens (creating as needed) the board for one run.
§Errors
Returns BoardError when the database cannot be opened or migrated.
Sourcepub fn register(&self, agent: &str) -> Result<(), BoardError>
pub fn register(&self, agent: &str) -> Result<(), BoardError>
Registers (or re-registers, idempotently) an agent in this run.
§Errors
Returns BoardError on storage failure.
Sourcepub fn set_status(&self, agent: &str, status: &str) -> Result<(), BoardError>
pub fn set_status(&self, agent: &str, status: &str) -> Result<(), BoardError>
Source§impl Board
impl Board
Sourcepub fn broadcast(&self, from_agent: &str, body: &str) -> Result<(), BoardError>
pub fn broadcast(&self, from_agent: &str, body: &str) -> Result<(), BoardError>
Queues a message to every current peer (to_agent NULL = broadcast).
§Errors
Returns BoardError on storage failure.
Sourcepub fn read(&self, agent: &str) -> Result<Vec<Message>, BoardError>
pub fn read(&self, agent: &str) -> Result<Vec<Message>, BoardError>
Unread messages for agent (broadcasts + directed), advancing the
auto-cursor so a second read never redelivers.
§Errors
Returns BoardError on storage failure.
Sourcepub fn claim(&self, agent: &str, path_glob: &str) -> Result<(), BoardError>
pub fn claim(&self, agent: &str, path_glob: &str) -> Result<(), BoardError>
Claims a path glob for agent. Idempotent for the holder; a claim
held by another agent in this run is a loud conflict.
§Errors
Returns BoardError::BadGlob for an invalid glob, Storage for
conflicts (constraint violation) and other database failures.
Sourcepub fn blocking_holder(
&self,
agent: &str,
file: &str,
) -> Result<Option<String>, BoardError>
pub fn blocking_holder( &self, agent: &str, file: &str, ) -> Result<Option<String>, BoardError>
The holder of a claim covering file, when that holder is not
agent — i.e. the gate-side question “is this write blocked?”.
§Errors
Returns BoardError on storage failure.