pub struct NodeState<A: SyncIOAddress, D: DeterministicState> {
pub my_address: A,
pub leader_address: Receiver<A>,
pub available_peers: Receiver<Vec<A>>,
pub state: SubscribableState<D>,
/* private fields */
}Fields§
§my_address: A§leader_address: Receiver<A>§available_peers: Receiver<Vec<A>>§state: SubscribableState<D>Implementations§
Source§impl<A, D> NodeState<A, D>where
A: SyncIOAddress,
D: DeterministicState,
impl<A, D> NodeState<A, D>where
A: SyncIOAddress,
D: DeterministicState,
pub fn new( my_address: A, leader_address: Receiver<A>, available_peers: Receiver<Vec<A>>, state: SubscribableState<D>, ) -> Self
pub fn leader_address(&self) -> A
pub fn available_peers(&self) -> Vec<A>
pub fn is_leader(&self) -> bool
pub fn is_connected_to_leader(&self) -> bool
pub fn set_connected_to_leader(&self, connected: bool)
pub fn set_connected_peer(&self, peer: Option<A>)
pub fn connected_peer(&self) -> Option<A>
pub fn debug_info(&self) -> DebugInfo<A>
Auto Trait Implementations§
impl<A, D> !Freeze for NodeState<A, D>
impl<A, D> !RefUnwindSafe for NodeState<A, D>
impl<A, D> !UnwindSafe for NodeState<A, D>
impl<A, D> Send for NodeState<A, D>
impl<A, D> Sync for NodeState<A, D>
impl<A, D> Unpin for NodeState<A, D>where
A: Unpin,
impl<A, D> UnsafeUnpin for NodeState<A, D>where
A: UnsafeUnpin,
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