Skip to main content

Board

Struct Board 

Source
pub struct Board { /* private fields */ }

Implementations§

Source§

impl Board

Source

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.

Source

pub fn register(&self, agent: &str) -> Result<(), BoardError>

Registers (or re-registers, idempotently) an agent in this run.

§Errors

Returns BoardError on storage failure.

Source

pub fn set_status(&self, agent: &str, status: &str) -> Result<(), BoardError>

Updates an agent’s free-text status line.

§Errors

Returns BoardError on storage failure.

Source

pub fn peers(&self, agent: &str) -> Result<Vec<Peer>, BoardError>

All agents in this run except agent itself.

§Errors

Returns BoardError on storage failure.

Source§

impl Board

Source

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.

Source

pub fn send( &self, from_agent: &str, to_agent: &str, body: &str, ) -> Result<(), BoardError>

Queues a directed message.

§Errors

Returns BoardError on storage failure.

Source

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.

Source

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.

Source

pub fn release(&self, agent: &str, path_glob: &str) -> Result<bool, BoardError>

Releases a claim; only the holder can release.

§Errors

Returns BoardError on storage failure.

Source

pub fn claims(&self) -> Result<Vec<Claim>, BoardError>

Active claims in this run.

§Errors

Returns BoardError on storage failure.

Source

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.

Auto Trait Implementations§

§

impl !Freeze for Board

§

impl !RefUnwindSafe for Board

§

impl !Sync for Board

§

impl !UnwindSafe for Board

§

impl Send for Board

§

impl Unpin for Board

§

impl UnsafeUnpin for Board

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.