pub enum NetworkScope {
V4,
V4WithInterface(Ipv4Addr),
V6,
V6WithInterface(u32),
}
Expand description
Network scope to be used by service discovery Default scope for services is to use IPV4 protocol
Variants§
V4
Uses IPV4 protocol with UNSPECIFIED network interface (0.0.0.0)
V4WithInterface(Ipv4Addr)
Uses IPV4 protocol and provided network interface
V6
Uses IPV6 protocol with UNSPECIFIED network interface (0)
V6WithInterface(u32)
Uses IPV6 protocol with provided network interface
Implementations§
Source§impl NetworkScope
impl NetworkScope
Sourcepub fn is_v4(&self) -> bool
pub fn is_v4(&self) -> bool
Returns true
if the network scope is V4
or V4WithInterface
.
Sourcepub fn socket_address(&self) -> SocketAddr
pub fn socket_address(&self) -> SocketAddr
Gets de socket address for the network scope.
Trait Implementations§
Source§impl Clone for NetworkScope
impl Clone for NetworkScope
Source§fn clone(&self) -> NetworkScope
fn clone(&self) -> NetworkScope
Returns a copy of the value. Read more
1.0.0 · 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 NetworkScope
impl Debug for NetworkScope
impl Copy for NetworkScope
Auto Trait Implementations§
impl Freeze for NetworkScope
impl RefUnwindSafe for NetworkScope
impl Send for NetworkScope
impl Sync for NetworkScope
impl Unpin for NetworkScope
impl UnwindSafe for NetworkScope
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