pub struct EngineConfigBuilder { /* private fields */ }Expand description
Builder for EngineConfig
Implementations§
Source§impl EngineConfigBuilder
impl EngineConfigBuilder
Sourcepub fn device_name(self, name: impl Into<String>) -> Self
pub fn device_name(self, name: impl Into<String>) -> Self
Set the device name shown to peers
Sourcepub fn download_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn download_dir(self, dir: impl Into<PathBuf>) -> Self
Set the download directory for received files
Sourcepub fn trusted_hosts(self, hosts: Vec<String>) -> Self
pub fn trusted_hosts(self, hosts: Vec<String>) -> Self
Set the list of trusted hosts (auto-accept transfers)
Sourcepub fn add_trusted_host(self, host: impl Into<String>) -> Self
pub fn add_trusted_host(self, host: impl Into<String>) -> Self
Add a single trusted host
Sourcepub fn receive_only(self, enabled: bool) -> Self
pub fn receive_only(self, enabled: bool) -> Self
Set receive-only mode
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
Set maximum retry attempts for transient failures
Sourcepub fn retry_delay_ms(self, delay_ms: u64) -> Self
pub fn retry_delay_ms(self, delay_ms: u64) -> Self
Set base delay between retries in milliseconds
Sourcepub fn bandwidth_limit_bps(self, limit: Option<u64>) -> Self
pub fn bandwidth_limit_bps(self, limit: Option<u64>) -> Self
Set bandwidth limit in bytes per second (None = unlimited)
Sourcepub fn build(self) -> EngineConfig
pub fn build(self) -> EngineConfig
Build the configuration
Trait Implementations§
Source§impl Default for EngineConfigBuilder
impl Default for EngineConfigBuilder
Source§fn default() -> EngineConfigBuilder
fn default() -> EngineConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EngineConfigBuilder
impl RefUnwindSafe for EngineConfigBuilder
impl Send for EngineConfigBuilder
impl Sync for EngineConfigBuilder
impl Unpin for EngineConfigBuilder
impl UnwindSafe for EngineConfigBuilder
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