Append a single entry proposed by the leader.
(&mut self, entry: LogEntry)
| 123 | |
| 124 | /// Append a single entry proposed by the leader. |
| 125 | pub fn append(&mut self, entry: LogEntry) -> Result<()> { |
| 126 | self.storage.append(std::slice::from_ref(&entry))?; |
| 127 | self.entries.push(entry); |
| 128 | Ok(()) |
| 129 | } |
| 130 | |
| 131 | /// Truncate entries from `index` onward (inclusive). |
| 132 | fn truncate_from(&mut self, index: u64) { |