pub struct InMemoryJournal { /* private fields */ }Expand description
Dev-only in-memory chain-signed journal.
Implementations§
Source§impl InMemoryJournal
impl InMemoryJournal
Sourcepub fn entries(&self) -> &[JournalEntry]
pub fn entries(&self) -> &[JournalEntry]
Borrow the full entry list — read-only view for transparency-log publishers.
Trait Implementations§
Source§impl Debug for InMemoryJournal
impl Debug for InMemoryJournal
Source§impl Default for InMemoryJournal
impl Default for InMemoryJournal
Source§fn default() -> InMemoryJournal
fn default() -> InMemoryJournal
Returns the “default value” for a type. Read more
Source§impl PersistentJournal for InMemoryJournal
impl PersistentJournal for InMemoryJournal
Source§fn append(
&mut self,
token: ConsumedToken,
signer: &dyn JournalSigner,
) -> Result<JournalEntry, JournalError>
fn append( &mut self, token: ConsumedToken, signer: &dyn JournalSigner, ) -> Result<JournalEntry, JournalError>
Append a consumed token. Duplicate
token_hash is rejected with
JournalError::DuplicateToken. Success returns the newly-created
entry so the caller can verify / publish it.Source§fn verify_chain(&self) -> Result<(), JournalError>
fn verify_chain(&self) -> Result<(), JournalError>
Full chain integrity + signature verification. Returns
Ok(()) if
every entry’s entry_hash matches its re-computation and every
signature validates under signer_pubkey; otherwise surfaces the
first failing index.Source§fn tip_hash(&self) -> [u8; 32]
fn tip_hash(&self) -> [u8; 32]
Last entry’s
entry_hash, or GENESIS_PREV_HASH for an empty
journal. Useful for external publishing (transparency log).Auto Trait Implementations§
impl Freeze for InMemoryJournal
impl RefUnwindSafe for InMemoryJournal
impl Send for InMemoryJournal
impl Sync for InMemoryJournal
impl Unpin for InMemoryJournal
impl UnsafeUnpin for InMemoryJournal
impl UnwindSafe for InMemoryJournal
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