pub struct Learner<T> {
pub id: u64,
pub messenger: Option<Box<dyn Messenger<T>>>,
pub last_accepted_n: u64,
pub accepted_received: HashMap<u64, HashSet<AcceptedData<T>>>,
pub value: Option<Arc<T>>,
pub quorum: u8,
}
Expand description
Learners act as the replication factor for the protocol. Once a Client request has been agreed on by the Acceptors, the Learner may take action (i.e.: execute the request and send a response to the client). To improve availability of processing, additional Learners can be added.
Fields§
§id: u64
Proposer
’s ID
messenger: Option<Box<dyn Messenger<T>>>
Messenger
specifying communication with other nodes
last_accepted_n: u64
The last proposal that was accepted
accepted_received: HashMap<u64, HashSet<AcceptedData<T>>>
Accepted messages received (proposal_n => data)
value: Option<Arc<T>>
The last accepted value
quorum: u8
Quorum size
Implementations§
Auto Trait Implementations§
impl<T> Freeze for Learner<T>
impl<T> !RefUnwindSafe for Learner<T>
impl<T> !Send for Learner<T>
impl<T> !Sync for Learner<T>
impl<T> Unpin for Learner<T>
impl<T> !UnwindSafe for Learner<T>
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