pub struct Response {
pub entities: Vec<Entity>,
pub links: Vec<Link>,
pub start_address: Option<Value>,
pub end_address: Option<Value>,
}Expand description
An RDAP response, cut down to what an abuse lookup reads.
Fields§
§entities: Vec<Entity>The contacts attached to this object.
links: Vec<Link>Links to other records, including the registrar record for a domain.
start_address: Option<Value>The first address of the network, on an IP record.
This is kept as it came, so a value that is not a string does not stop the
rest of the record from being read. Response::range reads it.
end_address: Option<Value>The last address of the network, on an IP record.
Implementations§
Source§impl Response
impl Response
Sourcepub fn range(&self) -> Option<RangeInclusive<IpAddr>>
pub fn range(&self) -> Option<RangeInclusive<IpAddr>>
Returns the addresses the network covers, on an IP record.
Returns None when the record gives no range, or a range that cannot be read:
an end that is not an address, two ends in different families, or an end
before the start.
Returns the registrar record for a domain, when the registry names one.
The registry record usually carries the abuse address of the registrar, under the registrar entity. Read the registrar record when you want the details the registry leaves out, such as the abuse telephone number. It is a second request, so make it only when you need it.
Sourcepub fn abuse_contacts(&self, scope: Scope, server: &str) -> Vec<Contact>
pub fn abuse_contacts(&self, scope: Scope, server: &str) -> Vec<Contact>
Returns every abuse contact in the response, each one time.
A value that is not an address, or that is a registry placeholder, is dropped.
One registry puts the same abuse entity at the top level and again under the registrant, so a walk of the tree finds it twice. The repeat says nothing, and this method drops it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more