pub struct LogChain { /* private fields */ }Expand description
Log chain state
Implementations§
Source§impl LogChain
impl LogChain
Sourcepub async fn append(&mut self, entry: LogEntry) -> Result<LogEntry, LogError>
pub async fn append(&mut self, entry: LogEntry) -> Result<LogEntry, LogError>
Append entry to chain
Sourcepub async fn append_committed(
&mut self,
entry: LogEntry,
) -> Result<(), LogError>
pub async fn append_committed( &mut self, entry: LogEntry, ) -> Result<(), LogError>
Append an already-committed entry (WAL replay path).
pub fn get_entry(&self, entry_id: &str) -> Option<&LogEntry>
Sourcepub fn generate_proof(&self, entry_id: &str) -> Option<ChainProof>
pub fn generate_proof(&self, entry_id: &str) -> Option<ChainProof>
Generate a compact inclusion proof for an entry.
The proof size is O(log n):
- one Merkle path proving target entry hash membership in the chain root
- one Merkle path proving chain head hash membership in the same root
Sourcepub fn current_hash(&self) -> &str
pub fn current_hash(&self) -> &str
Get current hash
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogChain
impl RefUnwindSafe for LogChain
impl Send for LogChain
impl Sync for LogChain
impl Unpin for LogChain
impl UnsafeUnpin for LogChain
impl UnwindSafe for LogChain
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