pub struct RaftService<Entry: Clone> { /* private fields */ }Implementations§
Source§impl<Entry: Clone + Serialize + Debug + 'static> RaftService<Entry>
impl<Entry: Clone + Serialize + Debug + 'static> RaftService<Entry>
pub fn create( network: &mut Network, sender: impl SenderExt<RaftEvent<Entry>> + Clone, ) -> Self
pub fn become_leader(&mut self, network: &mut Network) -> Result<()>
pub fn is_leader(&self) -> bool
Sourcepub fn request(&mut self, entry: Entry, network: &mut Network) -> Result<()>
pub fn request(&mut self, entry: Entry, network: &mut Network) -> Result<()>
Request to append entry to the log
pub fn step( &mut self, event: RaftEvent<Entry>, network: &mut Network, ) -> Result<()>
Auto Trait Implementations§
impl<Entry> Freeze for RaftService<Entry>
impl<Entry> !RefUnwindSafe for RaftService<Entry>
impl<Entry> Send for RaftService<Entry>where
Entry: Send,
impl<Entry> Sync for RaftService<Entry>where
Entry: Sync,
impl<Entry> Unpin for RaftService<Entry>where
Entry: Unpin,
impl<Entry> !UnwindSafe for RaftService<Entry>
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