Struct kipa_lib::Address [−][src]
An address of a node
Fields
ip_data: Vec<u8>
The IP address data
Can either be 4 bytes long for IPv4, or 16 bytes long for IPv6.
port: u16
The 16-bit port number of the address
Methods
impl Address
[src]
impl Address
pub fn new(ip_data: Vec<u8>, port: u16) -> Self
[src]
pub fn new(ip_data: Vec<u8>, port: u16) -> Self
Create a new address with some address and port
pub fn from_string(s: &str) -> InternalResult<Address>
[src]
pub fn from_string(s: &str) -> InternalResult<Address>
Create a new address from a string
pub fn get_local(
local_params: LocalAddressParams,
log: Logger
) -> InternalResult<Address>
[src]
pub fn get_local(
local_params: LocalAddressParams,
log: Logger
) -> InternalResult<Address>
Get the local address on a specified interface
pub fn from_socket_addr(socket_addr: &SocketAddr) -> Result<Self>
[src]
pub fn from_socket_addr(socket_addr: &SocketAddr) -> Result<Self>
Create an Address
from a SocketAddr
pub fn to_socket_addr(&self) -> Result<SocketAddr>
[src]
pub fn to_socket_addr(&self) -> Result<SocketAddr>
Get the SocketAddr
for the address
Trait Implementations
impl Into<Result<Address>> for Address
[src]
impl Into<Result<Address>> for Address
impl Clone for Address
[src]
impl Clone for Address
fn clone(&self) -> Address
[src]
fn clone(&self) -> Address
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Eq for Address
[src]
impl Eq for Address
impl PartialEq for Address
[src]
impl PartialEq for Address
fn eq(&self, other: &Address) -> bool
[src]
fn eq(&self, other: &Address) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Address) -> bool
[src]
fn ne(&self, other: &Address) -> bool
This method tests for !=
.
impl Hash for Address
[src]
impl Hash for Address
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for Address
[src]
impl Display for Address