pub struct Roast {
signer: RoastSigner,
coordinator: Option<RoastCoordinator>,
public_key_package: PublicKeyPackage,
coordinators: BTreeSet<Identifier>,
}
Expand description
The main state machine that manages the overall ROAST protocol by integrating [‘RoastSigner’] and [‘RoastCoordinator’].
Fields§
§signer: RoastSigner
§coordinator: Option<RoastCoordinator>
§public_key_package: PublicKeyPackage
§coordinators: BTreeSet<Identifier>
Implementations§
Source§impl Roast
impl Roast
Sourcepub fn new(
id: Identifier,
threshold: u16,
key_package: KeyPackage,
public_key_package: PublicKeyPackage,
coordinators: BTreeSet<Identifier>,
) -> Self
pub fn new( id: Identifier, threshold: u16, key_package: KeyPackage, public_key_package: PublicKeyPackage, coordinators: BTreeSet<Identifier>, ) -> Self
Creates a new Roast
instance with the given parameters.
Sourcepub fn on_message(&mut self, peer: Identifier, msg: RoastMessage, span: &Span)
pub fn on_message(&mut self, peer: Identifier, msg: RoastMessage, span: &Span)
Handles an incoming message from a peer.
Sourcepub fn next_action(&mut self, span: &Span) -> Option<RoastAction>
pub fn next_action(&mut self, span: &Span) -> Option<RoastAction>
Determines the next action to be taken by the state machine.
Auto Trait Implementations§
impl Freeze for Roast
impl RefUnwindSafe for Roast
impl Send for Roast
impl Sync for Roast
impl Unpin for Roast
impl UnwindSafe for Roast
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