Struct brb_membership::brb_membership::State
source · [−]pub struct State {
pub secret_key: SecretKey,
pub gen: Generation,
pub pending_gen: Generation,
pub forced_reconfigs: BTreeMap<Generation, BTreeSet<Reconfig>>,
pub history: BTreeMap<Generation, SignedVote>,
pub votes: BTreeMap<PublicKey, SignedVote>,
pub faulty: bool,
}
Fields
secret_key: SecretKey
gen: Generation
pending_gen: Generation
forced_reconfigs: BTreeMap<Generation, BTreeSet<Reconfig>>
history: BTreeMap<Generation, SignedVote>
votes: BTreeMap<PublicKey, SignedVote>
faulty: bool
Implementations
sourceimpl State
impl State
pub fn from(secret_key: SecretKey) -> State
pub fn random(rng: impl Rng + CryptoRng) -> State
pub fn public_key(&self) -> PublicKey
pub fn force_join(&mut self, actor: PublicKey)
pub fn force_leave(&mut self, actor: PublicKey)
pub fn members(&self, gen: Generation) -> Result<BTreeSet<PublicKey>>
pub fn propose(&mut self, reconfig: Reconfig) -> Result<Vec<VoteMsg>>
pub fn anti_entropy(&self, from_gen: Generation, actor: PublicKey) -> Vec<VoteMsg>
pub fn handle_signed_vote(
&mut self,
signed_vote: SignedVote
) -> Result<Vec<VoteMsg>>
pub fn sign_vote(&self, vote: Vote) -> Result<SignedVote>
pub fn validate_signed_vote(&self, signed_vote: &SignedVote) -> Result<()>
pub fn validate_reconfig(&self, reconfig: Reconfig) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more