pub struct MutationGuard { /* private fields */ }Expand description
Mutation Guard - The Dead Man’s Switch
Monitors capsule integrity and triggers self-destruction on breach. Zero-allocation, O(1) operations.
Implementations§
Source§impl MutationGuard
impl MutationGuard
Sourcepub fn new(data: &[u8], max_accesses: u64) -> Self
pub fn new(data: &[u8], max_accesses: u64) -> Self
Create new mutation guard
§Arguments
data- Data to protectmax_accesses- Maximum execution attempts before lockout
Sourcepub fn is_breached(&self) -> bool
pub fn is_breached(&self) -> bool
Check if guard is breached
Sourcepub fn verify(&self, data: &[u8]) -> bool
pub fn verify(&self, data: &[u8]) -> bool
Verify data integrity
Returns true if data is intact, false and triggers breach if tampered.
Sourcepub fn integrity_hash(&self) -> [u8; 32]
pub fn integrity_hash(&self) -> [u8; 32]
Get integrity hash (for audit after destruction)
Sourcepub fn access_count(&self) -> u64
pub fn access_count(&self) -> u64
Get access count
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MutationGuard
impl RefUnwindSafe for MutationGuard
impl Send for MutationGuard
impl Sync for MutationGuard
impl Unpin for MutationGuard
impl UnwindSafe for MutationGuard
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