pub struct EvolutionaryGuard { /* private fields */ }Expand description
Evolutionary Guard - The self-evolving immune system
Learns from attacks, generates new defenses, and evolves constantly.
Implementations§
Source§impl EvolutionaryGuard
impl EvolutionaryGuard
Sourcepub fn new() -> Result<Self, CryptoError>
pub fn new() -> Result<Self, CryptoError>
Create new evolutionary guard
Sourcepub fn learn(&self, denial: &DenialProof) -> Option<SignedFilter>
pub fn learn(&self, denial: &DenialProof) -> Option<SignedFilter>
Process a denial proof and learn from it
This is the core learning function.
Sourcepub fn should_block(
&self,
action_type: &ActionType,
description: &str,
) -> Option<String>
pub fn should_block( &self, action_type: &ActionType, description: &str, ) -> Option<String>
Check if an action should be blocked by evolved filters
Sourcepub fn take_pending_broadcasts(&self) -> Vec<SignedFilter>
pub fn take_pending_broadcasts(&self) -> Vec<SignedFilter>
Get pending broadcasts (for mesh distribution)
Sourcepub fn receive_filter(&self, filter: SignedFilter)
pub fn receive_filter(&self, filter: SignedFilter)
Receive filter from mesh network
Sourcepub fn memory(&self) -> Arc<ImmunityMemory>
pub fn memory(&self) -> Arc<ImmunityMemory>
Get immunity memory
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Get current generation
Sourcepub fn filter_count(&self) -> usize
pub fn filter_count(&self) -> usize
Get active filter count
Sourcepub fn threat_stats(&self) -> HashMap<AttackCategory, u64>
pub fn threat_stats(&self) -> HashMap<AttackCategory, u64>
Get threat statistics
Sourcepub fn broadcast_immunity(&self, sync: &SyncProtocol) -> usize
pub fn broadcast_immunity(&self, sync: &SyncProtocol) -> usize
Sourcepub fn sync_from_mesh(&self, fingerprints: &[CompactedThreatFingerprint])
pub fn sync_from_mesh(&self, fingerprints: &[CompactedThreatFingerprint])
Sync immunity from the mesh
Receives and processes threat fingerprints from other nodes.
Sourcepub fn deactivate(&self)
pub fn deactivate(&self)
Deactivate guard
Auto Trait Implementations§
impl !Freeze for EvolutionaryGuard
impl !RefUnwindSafe for EvolutionaryGuard
impl Send for EvolutionaryGuard
impl Sync for EvolutionaryGuard
impl Unpin for EvolutionaryGuard
impl !UnwindSafe for EvolutionaryGuard
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