pub struct Room {
pub id: ConnectionIndex,
pub connections: HashMap<ConnectionIndex, Connection>,
pub leader_index: ConnectionIndex,
pub term: Term,
}Fields§
§id: ConnectionIndex§connections: HashMap<ConnectionIndex, Connection>§leader_index: ConnectionIndex§term: TermImplementations§
Source§impl Room
impl Room
pub fn new() -> Self
Sourcepub fn has_most_lost_connection_to_leader(&self) -> bool
pub fn has_most_lost_connection_to_leader(&self) -> bool
checks if most connections, that are on the same term, has lost connection to leader
pub fn connection_with_most_knowledge_and_acceptable_quality( &self, exclude_index: ConnectionIndex, ) -> ConnectionIndex
pub fn change_leader_if_down_voted(&mut self)
pub fn create_connection(&mut self, time: Instant) -> &mut Connection
Auto Trait Implementations§
impl Freeze for Room
impl RefUnwindSafe for Room
impl Send for Room
impl Sync for Room
impl Unpin for Room
impl UnwindSafe for Room
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