pub struct Config { /* private fields */ }
Expand description
Configuration of a datagram transport.
Implementations§
source§impl Config
impl Config
sourcepub fn set_max_parallel(&mut self, value: usize)
pub fn set_max_parallel(&mut self, value: usize)
Sets the maximum number of parallel requests.
Once this many number of requests are currently outstanding, additional requests will wait.
If this value is too small or too large, it will be capped.
sourcepub fn max_parallel(&self) -> usize
pub fn max_parallel(&self) -> usize
Returns the maximum number of parallel requests.
sourcepub fn set_read_timeout(&mut self, value: Duration)
pub fn set_read_timeout(&mut self, value: Duration)
Sets the read timeout.
The read timeout is the maximum amount of time to wait for any response after a request was sent.
If this value is too small or too large, it will be capped.
sourcepub fn read_timeout(&self) -> Duration
pub fn read_timeout(&self) -> Duration
Returns the read timeout.
sourcepub fn set_max_retries(&mut self, value: u8)
pub fn set_max_retries(&mut self, value: u8)
Sets the maximum number of times a request is retried before giving up.
If this value is too small or too large, it will be capped.
sourcepub fn max_retries(&self) -> u8
pub fn max_retries(&self) -> u8
Returns the maximum number of request retries.
sourcepub fn set_udp_payload_size(&mut self, value: Option<u16>)
pub fn set_udp_payload_size(&mut self, value: Option<u16>)
Sets the requested UDP payload size.
This value indicates to the server the maximum size of a UDP packet. For UDP on public networks, this value should be left at the default of 1232 to avoid issues rising from packet fragmentation. See draft-ietf-dnsop-avoid-fragmentation for a discussion on these issues and recommendations.
On private networks or protocols other than UDP, other values can be used.
Setting the UDP payload size to None
currently results in messages
that will not include an OPT record.
sourcepub fn udp_payload_size(&self) -> Option<u16>
pub fn udp_payload_size(&self) -> Option<u16>
Returns the UDP payload size.
sourcepub fn set_recv_size(&mut self, size: usize)
pub fn set_recv_size(&mut self, size: usize)
Sets the receive buffer size.
This is the amount of memory that is allocated for receiving a response.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)