pub struct Shield { /* private fields */ }Expand description
Security shield that tracks protection status
Implementations§
Source§impl Shield
impl Shield
Sourcepub fn with_config(config: ShieldConfig) -> Self
pub fn with_config(config: ShieldConfig) -> Self
Create a new shield with specific config
Sourcepub fn set_active(&self, active: bool)
pub fn set_active(&self, active: bool)
Set shield active status
Sourcepub fn set_event_processor_enabled(&self, enabled: bool)
pub fn set_event_processor_enabled(&self, enabled: bool)
Set whether event processor (advanced protection) is enabled
Sourcepub fn is_event_processor_enabled(&self) -> bool
pub fn is_event_processor_enabled(&self) -> bool
Check if event processor (advanced protection) is enabled
Sourcepub fn set_event_processor(&self, processor: &Arc<dyn SecurityEventProcessor>)
pub fn set_event_processor(&self, processor: &Arc<dyn SecurityEventProcessor>)
Set event processor reference for correlation data
Sourcepub fn record_threats(&self, threats: &[Threat])
pub fn record_threats(&self, threats: &[Threat])
Record detected threats
Sourcepub fn get_info(&self) -> ShieldInfo
pub fn get_info(&self) -> ShieldInfo
Get shield information
Sourcepub fn get_recent_threats(&self, limit: usize) -> Vec<Threat>
pub fn get_recent_threats(&self, limit: usize) -> Vec<Threat>
Get recent threats
Sourcepub fn get_threat_stats(&self) -> HashMap<ThreatType, u64>
pub fn get_threat_stats(&self) -> HashMap<ThreatType, u64>
Get threat statistics by type
Sourcepub async fn start_display(self: Arc<Self>) -> Result<()>
pub async fn start_display(self: Arc<Self>) -> Result<()>
Start the shield display if configured
Sourcepub const fn start_time(&self) -> Instant
pub const fn start_time(&self) -> Instant
Get the start time of the shield
Sourcepub fn stats(&self) -> ShieldStats
pub fn stats(&self) -> ShieldStats
Get shield statistics
Sourcepub fn last_threat_type(&self) -> Option<String>
pub fn last_threat_type(&self) -> Option<String>
Get the last threat type if any
Sourcepub fn scanner_stats(&self) -> ScannerStats
pub fn scanner_stats(&self) -> ScannerStats
Get scanner statistics
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Set enabled state
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Shield
impl RefUnwindSafe for Shield
impl Send for Shield
impl Sync for Shield
impl Unpin for Shield
impl UnwindSafe for Shield
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more