Struct clamd_client::ClamdClientBuilder
source · pub struct ClamdClientBuilder<'a> { /* private fields */ }Expand description
Builder for ClamdClient.
Example
let address = "127.0.0.1:3310".parse::<SocketAddr>()?;
let mut clamd_client = ClamdClientBuilder::tcp_socket(&address).chunk_size(4096).build();Implementations
sourceimpl<'a> ClamdClientBuilder<'a>
impl<'a> ClamdClientBuilder<'a>
sourcepub fn unix_socket<P: AsRef<Path> + ?Sized>(path: &'a P) -> Self
pub fn unix_socket<P: AsRef<Path> + ?Sized>(path: &'a P) -> Self
Build a ClamdClient from the path to the unix socket of clamd.
sourcepub fn tcp_socket(addr: &'a SocketAddr) -> Self
pub fn tcp_socket(addr: &'a SocketAddr) -> Self
Build a ClamdClient from the socket address to the tcp socket of clamd.
sourcepub fn chunk_size(&'a mut self, chunk_size: usize) -> &'a mut Self
pub fn chunk_size(&'a mut self, chunk_size: usize) -> &'a mut Self
Set the chunk size for file streaming. Default is DEFAULT_CHUNK_SIZE.
sourcepub fn build(&'a self) -> ClamdClient
pub fn build(&'a self) -> ClamdClient
Create ClamdClient with provided configuration.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ClamdClientBuilder<'a>
impl<'a> Send for ClamdClientBuilder<'a>
impl<'a> Sync for ClamdClientBuilder<'a>
impl<'a> Unpin for ClamdClientBuilder<'a>
impl<'a> UnwindSafe for ClamdClientBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more