EvolutionaryGuard

Struct EvolutionaryGuard 

Source
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

Source

pub fn new() -> Result<Self, CryptoError>

Create new evolutionary guard

Source

pub fn learn(&self, denial: &DenialProof) -> Option<SignedFilter>

Process a denial proof and learn from it

This is the core learning function.

Source

pub fn should_block( &self, action_type: &ActionType, description: &str, ) -> Option<String>

Check if an action should be blocked by evolved filters

Source

pub fn evolve(&self)

Evolve all filters (polymorphic mutation)

Source

pub fn take_pending_broadcasts(&self) -> Vec<SignedFilter>

Get pending broadcasts (for mesh distribution)

Source

pub fn receive_filter(&self, filter: SignedFilter)

Receive filter from mesh network

Source

pub fn memory(&self) -> Arc<ImmunityMemory>

Get immunity memory

Source

pub fn generation(&self) -> u64

Get current generation

Source

pub fn filter_count(&self) -> usize

Get active filter count

Source

pub fn id(&self) -> &str

Get guard ID

Source

pub fn threat_stats(&self) -> HashMap<AttackCategory, u64>

Get threat statistics

Source

pub fn broadcast_immunity(&self, sync: &SyncProtocol) -> usize

Broadcast immunity to the global mesh

This method integrates with the Genesis Protocol’s SyncProtocol to propagate learned threats across the entire mesh network.

§Arguments
  • sync - The SyncProtocol instance for mesh communication
§Returns

Number of filters broadcasted

Source

pub fn sync_from_mesh(&self, fingerprints: &[CompactedThreatFingerprint])

Sync immunity from the mesh

Receives and processes threat fingerprints from other nodes.

Source

pub fn deactivate(&self)

Deactivate guard

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V