pub struct ResolvedNetworkTarget { /* private fields */ }Expand description
A normalized hostname or literal together with the exact addresses a backend resolved for one connection attempt.
Implementations§
Source§impl ResolvedNetworkTarget
impl ResolvedNetworkTarget
Sourcepub fn new(
domain: impl Into<String>,
addresses: impl IntoIterator<Item = SocketAddr>,
) -> Result<Self, PolicyError>
pub fn new( domain: impl Into<String>, addresses: impl IntoIterator<Item = SocketAddr>, ) -> Result<Self, PolicyError>
Creates a target from a host and the addresses resolved for it.
An empty address list represents failed or timed-out resolution and is
retained so policy evaluation can fail closed with Deny.
Sourcepub fn addresses(&self) -> &[SocketAddr]
pub fn addresses(&self) -> &[SocketAddr]
Returns the exact addresses captured for this resolution attempt.
Sourcepub fn contains_address(&self, address: SocketAddr) -> bool
pub fn contains_address(&self, address: SocketAddr) -> bool
Returns whether an actual connection address belongs to this snapshot.
Trait Implementations§
Source§impl Clone for ResolvedNetworkTarget
impl Clone for ResolvedNetworkTarget
Source§fn clone(&self) -> ResolvedNetworkTarget
fn clone(&self) -> ResolvedNetworkTarget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResolvedNetworkTarget
impl Debug for ResolvedNetworkTarget
impl Eq for ResolvedNetworkTarget
Source§impl PartialEq for ResolvedNetworkTarget
impl PartialEq for ResolvedNetworkTarget
impl StructuralPartialEq for ResolvedNetworkTarget
Auto Trait Implementations§
impl Freeze for ResolvedNetworkTarget
impl RefUnwindSafe for ResolvedNetworkTarget
impl Send for ResolvedNetworkTarget
impl Sync for ResolvedNetworkTarget
impl Unpin for ResolvedNetworkTarget
impl UnsafeUnpin for ResolvedNetworkTarget
impl UnwindSafe for ResolvedNetworkTarget
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