pub struct FetchAddressPolicy { /* private fields */ }Expand description
Immutable IP-address policy applied to every DNS answer and peer address.
Implementations§
Source§impl FetchAddressPolicy
impl FetchAddressPolicy
Sourcepub const fn public_network() -> Self
pub const fn public_network() -> Self
Creates the production public-network policy.
Sourcepub const fn loopback_tests() -> Self
pub const fn loopback_tests() -> Self
Creates a policy for deterministic loopback fixture servers.
All non-loopback private, link-local, reserved, and multicast ranges remain forbidden.
Sourcepub fn validate<I>(
&self,
addresses: I,
) -> Result<ValidatedFetchAddresses, FetchAddressPolicyError>where
I: IntoIterator<Item = IpAddr>,
pub fn validate<I>(
&self,
addresses: I,
) -> Result<ValidatedFetchAddresses, FetchAddressPolicyError>where
I: IntoIterator<Item = IpAddr>,
Validates every resolved A/AAAA answer and returns a deterministic set.
§Errors
Rejects empty answers and the entire answer set when any address is forbidden. This prevents a safe first record from hiding a private or metadata address later in the DNS response.
Trait Implementations§
Source§impl Clone for FetchAddressPolicy
impl Clone for FetchAddressPolicy
impl Copy for FetchAddressPolicy
Source§impl Debug for FetchAddressPolicy
impl Debug for FetchAddressPolicy
Source§impl Default for FetchAddressPolicy
impl Default for FetchAddressPolicy
impl Eq for FetchAddressPolicy
Source§impl Ord for FetchAddressPolicy
impl Ord for FetchAddressPolicy
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FetchAddressPolicy
impl PartialEq for FetchAddressPolicy
Source§impl PartialOrd for FetchAddressPolicy
impl PartialOrd for FetchAddressPolicy
impl StructuralPartialEq for FetchAddressPolicy
Auto Trait Implementations§
impl Freeze for FetchAddressPolicy
impl RefUnwindSafe for FetchAddressPolicy
impl Send for FetchAddressPolicy
impl Sync for FetchAddressPolicy
impl Unpin for FetchAddressPolicy
impl UnsafeUnpin for FetchAddressPolicy
impl UnwindSafe for FetchAddressPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.