#[non_exhaustive]pub struct IpInfo {
pub country: Option<String>,
pub asn: Option<u32>,
pub anonymity: Option<Anonymity>,
pub city: Option<String>,
pub network: Option<String>,
}Expand description
What an IpIntel source knows about an address.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.country: Option<String>ISO 3166-1 alpha-2 country code.
asn: Option<u32>Autonomous system number.
anonymity: Option<Anonymity>Whether the address belongs to a VPN, proxy, hosting provider or Tor. None when the
source does not know.
city: Option<String>The city’s English name, e.g. from a MaxMind City database. For display; not scored.
network: Option<String>The name of the organization behind the autonomous system, e.g. "Example Telecom".
For display; not scored.
Implementations§
Source§impl IpInfo
impl IpInfo
Sourcepub fn new(country: Option<String>, asn: Option<u32>) -> Self
pub fn new(country: Option<String>, asn: Option<u32>) -> Self
Builds an IpInfo without anonymity, city or network information.
Sourcepub fn with_anonymity(self, anonymity: Anonymity) -> Self
pub fn with_anonymity(self, anonymity: Anonymity) -> Self
Sets what the source knows about the network hiding the client.
Sourcepub fn with_network(self, network: impl Into<String>) -> Self
pub fn with_network(self, network: impl Into<String>) -> Self
Sets the name of the organization behind the autonomous system.
Trait Implementations§
impl Eq for IpInfo
impl StructuralPartialEq for IpInfo
Auto Trait Implementations§
impl Freeze for IpInfo
impl RefUnwindSafe for IpInfo
impl Send for IpInfo
impl Sync for IpInfo
impl Unpin for IpInfo
impl UnsafeUnpin for IpInfo
impl UnwindSafe for IpInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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