#[non_exhaustive]pub struct WhoIsLookupOptions {
pub target: Target,
pub server: Option<WhoIsServerValue>,
pub follow: u16,
pub timeout: Option<Duration>,
pub max_response_size: Option<usize>,
}Expand description
The options about how to lookup.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.target: TargetThe target that you want to lookup.
server: Option<WhoIsServerValue>The WHOIS server that you want to use. If it is None, an appropriate WHOIS server will be chosen from the list of WHOIS servers that the WhoIs instance have. The default value is None.
follow: u16Number of times to follow redirects. The default value is 2.
timeout: Option<Duration>The timeout of each connection to a WHOIS server. None means no timeout at all. The default value is 60 seconds.
The timeout is a budget for one connection: it covers resolving the address of the server, connecting to it (even when the server has several addresses to try) and reading the whole response. A lookup which follows referrals spends one budget per connection, so it can take up to follow + 1 times this value.
max_response_size: Option<usize>The maximum number of bytes to accept from a WHOIS server. A bigger response makes the lookup fail instead of being truncated. None means no limit at all, which lets a broken or malicious server exhaust the memory. The default value is 4 MiB.
Implementations§
Source§impl WhoIsLookupOptions
impl WhoIsLookupOptions
Sourcepub fn from_target(target: Target) -> WhoIsLookupOptions
pub fn from_target(target: Target) -> WhoIsLookupOptions
Create options with the default settings for a target.
Sourcepub fn from_str<S: AsRef<str>>(s: S) -> Result<WhoIsLookupOptions, WhoIsError>
pub fn from_str<S: AsRef<str>>(s: S) -> Result<WhoIsLookupOptions, WhoIsError>
Parse a domain or an IP into a target and create options with the default settings.
Sourcepub fn from_string<S: Into<String>>(
s: S,
) -> Result<WhoIsLookupOptions, WhoIsError>
pub fn from_string<S: Into<String>>( s: S, ) -> Result<WhoIsLookupOptions, WhoIsError>
Parse a domain or an IP into a target and create options with the default settings. The string may be reused as the target, avoiding an allocation.
Trait Implementations§
Source§impl Clone for WhoIsLookupOptions
impl Clone for WhoIsLookupOptions
Source§fn clone(&self) -> WhoIsLookupOptions
fn clone(&self) -> WhoIsLookupOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more