pub struct Bootstrap { /* private fields */ }Expand description
Discovers the authoritative RDAP server URL for a query target.
Thread-safe: the cache is behind a RwLock, and a single Bootstrap
instance can be shared across tasks via Arc<Bootstrap>.
Implementations§
Source§impl Bootstrap
impl Bootstrap
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Creates a new resolver using the official IANA bootstrap endpoint.
Sourcepub fn with_base_url(base_url: impl Into<String>, client: Client) -> Self
pub fn with_base_url(base_url: impl Into<String>, client: Client) -> Self
Creates a resolver with a custom base URL (useful for testing).
Sourcepub fn set_custom_servers(&mut self, servers: HashMap<String, String>)
pub fn set_custom_servers(&mut self, servers: HashMap<String, String>)
Registers custom TLD → RDAP server URL overrides.
Sourcepub async fn for_domain(&self, domain: &str) -> Result<String>
pub async fn for_domain(&self, domain: &str) -> Result<String>
Returns the RDAP server base URL for a domain (by TLD).
Sourcepub async fn for_ipv4(&self, ip: &str) -> Result<String>
pub async fn for_ipv4(&self, ip: &str) -> Result<String>
Returns the RDAP server base URL for an IPv4 address.
Sourcepub async fn for_ipv6(&self, ip: &str) -> Result<String>
pub async fn for_ipv6(&self, ip: &str) -> Result<String>
Returns the RDAP server base URL for an IPv6 address.
Sourcepub async fn for_asn(&self, asn: u32) -> Result<String>
pub async fn for_asn(&self, asn: u32) -> Result<String>
Returns the RDAP server base URL for an ASN.
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clears the in-memory bootstrap cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bootstrap
impl !RefUnwindSafe for Bootstrap
impl Send for Bootstrap
impl Sync for Bootstrap
impl Unpin for Bootstrap
impl UnsafeUnpin for Bootstrap
impl !UnwindSafe for Bootstrap
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