get_version

Function get_version 

Source
pub async fn get_version<T: TransportProtocol>(connection: T) -> IoResult
Expand description

Gets the version number from ClamAV

This function establishes a connection to a ClamAV server and sends the VERSION command to it. If the server is available, it responds with its version number.

§Arguments

  • connection: The connection type to use - either TCP or a Unix socket connection

§Returns

An IoResult containing the server’s response as a vector of bytes

§Example

let clamd_tcp = clamav_client::async_std::Tcp{ host_address: "localhost:3310" };
let version = clamav_client::async_std::get_version(clamd_tcp).await.unwrap();