pub struct NetworkAddress {
pub ip: IpAddr,
pub port: u16,
pub flags: u16,
}Expand description
Network address (IPv4/IPv6 + port + flags).
§Examples
use moonpool_core::NetworkAddress;
use std::net::{IpAddr, Ipv4Addr};
let addr = NetworkAddress::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 4500);
assert_eq!(addr.to_string(), "127.0.0.1:4500");Fields§
§ip: IpAddrIP address (IPv4 or IPv6).
port: u16Port number.
flags: u16Address flags (TLS, public routing).
Implementations§
Source§impl NetworkAddress
impl NetworkAddress
Sourcepub fn with_flags(ip: IpAddr, port: u16, flags: u16) -> Self
pub fn with_flags(ip: IpAddr, port: u16, flags: u16) -> Self
Create a new network address with flags.
Trait Implementations§
Source§impl Clone for NetworkAddress
impl Clone for NetworkAddress
Source§fn clone(&self) -> NetworkAddress
fn clone(&self) -> NetworkAddress
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkAddress
impl Debug for NetworkAddress
Source§impl<'de> Deserialize<'de> for NetworkAddress
impl<'de> Deserialize<'de> for NetworkAddress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NetworkAddress
impl Display for NetworkAddress
Source§impl Hash for NetworkAddress
impl Hash for NetworkAddress
Source§impl PartialEq for NetworkAddress
impl PartialEq for NetworkAddress
Source§impl Serialize for NetworkAddress
impl Serialize for NetworkAddress
impl Eq for NetworkAddress
impl StructuralPartialEq for NetworkAddress
Auto Trait Implementations§
impl Freeze for NetworkAddress
impl RefUnwindSafe for NetworkAddress
impl Send for NetworkAddress
impl Sync for NetworkAddress
impl Unpin for NetworkAddress
impl UnwindSafe for NetworkAddress
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)