pub trait WriteGate: Send + Sync {
// Required methods
fn admit(
&mut self,
payload: &WritePayload,
) -> Result<WriteReceipt, GateError>;
fn verify_receipt(&self, receipt: &WriteReceipt) -> bool;
fn chain_root(&self) -> [u8; 32];
fn len(&self) -> usize;
fn variant(&self) -> GateVariant;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Core admission gate trait for vector writes.
Each gate variant encapsulates one integrity strategy. Callers insert a
WritePayload and receive a WriteReceipt that commits the gate’s
current chain state. Receipts can be stored alongside the vector index
entry and verified offline.
Required Methods§
Sourcefn admit(&mut self, payload: &WritePayload) -> Result<WriteReceipt, GateError>
fn admit(&mut self, payload: &WritePayload) -> Result<WriteReceipt, GateError>
Admit a payload and return a tamper-evident receipt.
Sourcefn verify_receipt(&self, receipt: &WriteReceipt) -> bool
fn verify_receipt(&self, receipt: &WriteReceipt) -> bool
Verify that a receipt is consistent with the gate’s internal state.
Sourcefn chain_root(&self) -> [u8; 32]
fn chain_root(&self) -> [u8; 32]
Current chain commitment (root or chain head). Changes after every
successful admit().
Sourcefn variant(&self) -> GateVariant
fn variant(&self) -> GateVariant
Gate variant identifier.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".