Struct ClamStats

Source
pub struct ClamStats {
Show 14 fields pub pools: u64, pub state: String, pub threads_live: u64, pub threads_idle: u64, pub threads_max: u64, pub threads_idle_timeout_secs: u64, pub queue: u64, pub mem_heap: String, pub mem_mmap: String, pub mem_used: String, pub mem_free: String, pub mem_releasable: String, pub pools_used: String, pub pools_total: String,
}
Expand description

ClamStats provides all of the metrics that Clam provides via the STATS command as at version 0.100.

Fields§

§pools: u64

The number of pools available to ClamAV

§state: String

The state of the responding Clam Daemon

§threads_live: u64

The numbe of active threads owned by the Clam Daemon

§threads_idle: u64

The number of idle threads owned by the Clam Daemon

§threads_max: u64

The maximum number of threads the Clam Daemon can spawn

§threads_idle_timeout_secs: u64

The timeout (seconds) before a thread is determined to be idle

§queue: u64

The number of items in the queue awaiting processing

§mem_heap: String

Total memory allocated to the heap

§mem_mmap: String

Ammount of mmap’d memory used

§mem_used: String

Total memory used by the daemon

§mem_free: String

Total memory available to the daemon not in use

§mem_releasable: String

Total memory re

§pools_used: String

Total number of pools in use by the daemon

§pools_total: String

Total number of pools available to the daemon

Implementations§

Source§

impl ClamStats

Source

pub fn parse(s_string: &str) -> ClamResult<Self>

ClamStats::parse takes a statistics output of the Clam STATS command and uses nom to parse that into a strongly typed struct.

Given that this is likely to be the most volatile area of returned data, it is likely that this will fail across different versions. This parses the data expected as of version 0.100.0. If it cannot parse the data, then the result is returned in its raw form insude ClamError::InvalidData.

Trait Implementations§

Source§

impl Debug for ClamStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ClamStats

Source§

fn eq(&self, other: &ClamStats) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ClamStats

Source§

fn partial_cmp(&self, other: &ClamStats) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for ClamStats

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, 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.