Clamd

Struct Clamd 

Source
pub struct Clamd { /* private fields */ }

Implementations§

Source§

impl Clamd

Source

pub fn new() -> Result<Clamd>

Connect to clamd with default socket

Source

pub fn local_connect<P: AsRef<Path>>(sock: P) -> Result<Clamd>

Connect to clamd with specificated socket

Source

pub fn ping(&mut self) -> Result<String>

Check the daemon’s state. It should reply with “PONG\0”.

Source

pub fn version(&mut self) -> Result<String>

Check the clamav and database versions.

Source

pub fn reload(&mut self) -> Result<String>

Reload the database.

Source

pub fn shutdown(&mut self) -> Result<()>

Shutdown the clamd service.

Source

pub fn scan<P: AsRef<Path>>(&mut self, path: P) -> Result<String>

Scan a file or directory (recursively).

Source

pub fn contscan<P: AsRef<Path>>(&mut self, path: P) -> Result<String>

Scan a file or directory (recursively) and don’t stop the scanning when a malware found.

Source

pub fn multiscan<P: AsRef<Path>>(&mut self, path: P) -> Result<String>

Scan a file or directory (recursively) using multi thread.

Source

pub fn instream_scan<P: AsRef<Path>>( &mut self, path: P, chunk_size: Option<u32>, ) -> Result<String>

Instream Scan.

Trait Implementations§

Source§

impl Debug for Clamd

Source§

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

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

impl Drop for Clamd

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Clamd

§

impl RefUnwindSafe for Clamd

§

impl Send for Clamd

§

impl Sync for Clamd

§

impl Unpin for Clamd

§

impl UnwindSafe for Clamd

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.