pub struct Message { /* private fields */ }Expand description
One agent’s broadcast: its belief about every task’s winner and winning bid, and the latest clock value it has seen of every agent.
A message is a snapshot of the sender’s state, so a receiver can merge it whenever it arrives, in any order, any number of times.
Implementations§
Source§impl Message
impl Message
Sourcepub fn clock(&self) -> u64
pub fn clock(&self) -> u64
The sender’s clock when it sent the message: how many messages it had sent, this one included.
Sourcepub fn winner(&self, task: TaskId) -> Option<AgentId>
pub fn winner(&self, task: TaskId) -> Option<AgentId>
The winner the sender believed in for task; None when it knew of no bid.
§Panics
Panics when task is not one of the message’s tasks.
Sourcepub fn winning_bid(&self, task: TaskId) -> u64
pub fn winning_bid(&self, task: TaskId) -> u64
The winning bid the sender believed in for task; zero when it knew of no bid.
§Panics
Panics when task is not one of the message’s tasks.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Message
impl Move for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more