Struct whois_rust::WhoIs
source · pub struct WhoIs { /* private fields */ }
Expand description
The WhoIs
structure stores the list of WHOIS servers in-memory.
Implementations§
source§impl WhoIs
impl WhoIs
sourcepub fn from_host<T: AsRef<str>>(host: T) -> Result<WhoIs, WhoIsError>
pub fn from_host<T: AsRef<str>>(host: T) -> Result<WhoIs, WhoIsError>
Create a WhoIs
instance which doesn’t have a WHOIS server list. You should provide the host that is used for query ip. You may want to use the host "whois.arin.net"
.
sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<WhoIs, WhoIsError>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<WhoIs, WhoIsError>
Read the list of WHOIS servers (JSON data) from a file to create a WhoIs
instance.
sourcepub async fn from_path_async<P: AsRef<Path>>(
path: P
) -> Result<WhoIs, WhoIsError>
pub async fn from_path_async<P: AsRef<Path>>( path: P ) -> Result<WhoIs, WhoIsError>
Read the list of WHOIS servers (JSON data) from a file to create a WhoIs
instance. For serde_json
doesn’t support async functions, consider just using the from_path
function.
sourcepub fn from_string<S: AsRef<str>>(string: S) -> Result<WhoIs, WhoIsError>
pub fn from_string<S: AsRef<str>>(string: S) -> Result<WhoIs, WhoIsError>
Read the list of WHOIS servers (JSON data) from a string to create a WhoIs
instance.
source§impl WhoIs
impl WhoIs
pub fn can_find_server_for_tld<T: AsRef<str>, D: AsRef<str>>( &mut self, tld: T, dns_server: D ) -> bool
sourcepub fn lookup(&self, options: WhoIsLookupOptions) -> Result<String, WhoIsError>
pub fn lookup(&self, options: WhoIsLookupOptions) -> Result<String, WhoIsError>
Lookup a domain or an IP.
source§impl WhoIs
impl WhoIs
sourcepub async fn lookup_async(
&self,
options: WhoIsLookupOptions
) -> Result<String, WhoIsError>
pub async fn lookup_async( &self, options: WhoIsLookupOptions ) -> Result<String, WhoIsError>
Lookup a domain or an IP.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for WhoIs
impl Send for WhoIs
impl Sync for WhoIs
impl Unpin for WhoIs
impl UnwindSafe for WhoIs
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