pub struct CnpSession {
pub task: String,
pub manager: Aid,
pub announcement_id: String,
pub phase: Phase,
pub bids: Vec<Aid>,
pub winner: Option<Aid>,
}Expand description
Tracker for one contract-net session.
Fields§
§task: String§manager: Aid§announcement_id: String§phase: Phase§bids: Vec<Aid>§winner: Option<Aid>Implementations§
Source§impl CnpSession
impl CnpSession
pub fn new(task: &str, manager: Aid, announcement_id: String) -> Self
Sourcepub fn announce(
&self,
key: &SigningKey,
action: ClAction,
participants: &[Aid],
) -> Vec<Envelope>
pub fn announce( &self, key: &SigningKey, action: ClAction, participants: &[Aid], ) -> Vec<Envelope>
Manager posts the task: request/Cl(action).
Sourcepub fn receive_bid(&mut self, env: &Envelope) -> Result<(), String>
pub fn receive_bid(&mut self, env: &Envelope) -> Result<(), String>
Participant bids: propose/Cl(commitment{proposed}). Returns Err if the phase is wrong or the reply is off-policy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CnpSession
impl RefUnwindSafe for CnpSession
impl Send for CnpSession
impl Sync for CnpSession
impl Unpin for CnpSession
impl UnsafeUnpin for CnpSession
impl UnwindSafe for CnpSession
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