struct Addr
pub struct Addr {
pub ip string
pub zone string
}Purpose
Structure encapsulating ip, zone.
Public fields
ipstring- field (string)
zonestring- field (string)
#net/netipAddr / AddrPort / Prefix: owning 4- or 16-byte addresses.
struct Addrpub struct Addr {
pub ip string
pub zone string
}Structure encapsulating ip, zone.
ip stringzone stringstruct AddrPortpub struct AddrPort {
pub addr Addr
pub port int
}Structure encapsulating addr, port.
addr Addrport intstruct Prefixpub struct Prefix {
pub addr Addr
pub bits int
}Structure encapsulating addr, bits.
addr Addrbits intaddr_from4pub fn addr_from4(a int, b int, c int, d int) AddrAddress from4.
a intb intc intd intAddr — a value of this type
addr_from16pub fn addr_from16(ip string) AddrAddress from16. Throws on failure; handle the error or propagate it to the caller.
ip stringAddr — a value of this type
parse_addrpub fn parse_addr(s string) AddrParse as addr. Throws on failure; handle the error or propagate it to the caller.
s stringAddr — a value of this type
(Addr) is_validpub fn (a Addr) is_valid() boolOperation on Addr: whether it is valid.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is4pub fn (a Addr) is4() boolExecute is4 on Addr.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is6pub fn (a Addr) is6() boolExecute is6 on Addr.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is4_in6pub fn (a Addr) is4_in6() boolOperation on Addr: is4 in6.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) unmappub fn (a Addr) unmap() AddrExecute unmap on Addr.
a AddrAddr instance used by this call (value receiver).Addr — a value of this type
(Addr) with_zonepub fn (a Addr) with_zone(zone string) AddrOperation on Addr: derive a new value with zone.
a AddrAddr instance used by this call (value receiver).zone stringAddr — a value of this type
(Addr) to_stringpub fn (a Addr) to_string() stringOperation on Addr: convert to string.
a AddrAddr instance used by this call (value receiver).string — result string
(Addr) is_unspecifiedpub fn (a Addr) is_unspecified() boolOperation on Addr: whether it is unspecified.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is_loopbackpub fn (a Addr) is_loopback() boolOperation on Addr: whether it is loopback.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is_privatepub fn (a Addr) is_private() boolOperation on Addr: whether it is private.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is_multicastpub fn (a Addr) is_multicast() boolOperation on Addr: whether it is multicast.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is_global_unicastpub fn (a Addr) is_global_unicast() boolOperation on Addr: whether it is global unicast.
a AddrAddr instance used by this call (value receiver).bool — true or false
(Addr) is_link_local_unicastpub fn (a Addr) is_link_local_unicast() boolOperation on Addr: whether it is link local unicast.
a AddrAddr instance used by this call (value receiver).bool — true or false
parse_addr_portpub fn parse_addr_port(s string) AddrPortParse as addr port. Throws on failure; handle the error or propagate it to the caller.
s stringAddrPort — a value of this type
(AddrPort) to_stringpub fn (ap AddrPort) to_string() stringOperation on AddrPort: convert to string.
ap AddrPortAddrPort instance used by this call (value receiver).string — result string
(AddrPort) is_validpub fn (ap AddrPort) is_valid() boolOperation on AddrPort: whether it is valid.
ap AddrPortAddrPort instance used by this call (value receiver).bool — true or false
parse_prefixpub fn parse_prefix(s string) PrefixParse as prefix. Throws on failure; handle the error or propagate it to the caller.
s stringPrefix — a value of this type
(Prefix) to_stringpub fn (p Prefix) to_string() stringOperation on Prefix: convert to string.
p PrefixPrefix instance used by this call (value receiver).string — result string
(Prefix) containspub fn (p Prefix) contains(a Addr) boolOperation on Prefix: report whether the input contains the given piece.
p PrefixPrefix instance used by this call (value receiver).a Addrbool — true or false