pub struct BlackBoxLog { /* private fields */ }Expand description
An append-only, AES-256-GCM-encrypted, JCS hash-linked event log. The key is 32 bytes. The encrypted blob is nonce(12) || ciphertext || tag(16), matching Python, TypeScript, and Go.
Implementations§
Source§impl BlackBoxLog
impl BlackBoxLog
Sourcepub fn new(key: &[u8], genesis_prev_hash_override: Option<&str>) -> Result<Self>
pub fn new(key: &[u8], genesis_prev_hash_override: Option<&str>) -> Result<Self>
Build a log. A None genesis uses genesis_prev_hash.
Sourcepub fn append(
&mut self,
event: &str,
payload: &Value,
timestamp: &str,
) -> Result<Value>
pub fn append( &mut self, event: &str, payload: &Value, timestamp: &str, ) -> Result<Value>
Encrypt payload, link it to the chain head, and return the new entry.
pub fn head(&self) -> &str
pub fn genesis(&self) -> &str
pub fn entries(&self) -> &[Value]
pub fn open(&self, entry: &Value) -> Result<Value>
Auto Trait Implementations§
impl Forget for BlackBoxLog
impl Freeze for BlackBoxLog
impl Move for BlackBoxLog
impl RefUnwindSafe for BlackBoxLog
impl Send for BlackBoxLog
impl Sync for BlackBoxLog
impl Unpin for BlackBoxLog
impl UnsafeUnpin for BlackBoxLogwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
impl UnwindSafe for BlackBoxLog
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