pub struct NetAddress {
pub ip: IpAddress,
pub port: u16,
}Expand description
A network address, equivalent of a SocketAddr.
Fields§
§ip: IpAddress§port: u16Implementations§
Source§impl NetAddress
impl NetAddress
pub fn new(ip: IpAddress, port: u16) -> Self
pub fn prefix_bucket(&self) -> PrefixBucket
Trait Implementations§
Source§impl BorshDeserialize for NetAddress
impl BorshDeserialize for NetAddress
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for NetAddress
impl BorshSerialize for NetAddress
Source§impl Clone for NetAddress
impl Clone for NetAddress
Source§fn clone(&self) -> NetAddress
fn clone(&self) -> NetAddress
Returns a duplicate 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 NetAddress
impl Debug for NetAddress
Source§impl<'de> Deserialize<'de> for NetAddress
impl<'de> Deserialize<'de> for NetAddress
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 NetAddress
impl Display for NetAddress
Source§impl From<&NetAddress> for PrefixBucket
impl From<&NetAddress> for PrefixBucket
Source§fn from(net_address: &NetAddress) -> Self
fn from(net_address: &NetAddress) -> Self
Converts to this type from the input type.
Source§impl From<NetAddress> for ContextualNetAddress
impl From<NetAddress> for ContextualNetAddress
Source§fn from(value: NetAddress) -> Self
fn from(value: NetAddress) -> Self
Converts to this type from the input type.
Source§impl From<NetAddress> for SocketAddr
impl From<NetAddress> for SocketAddr
Source§fn from(value: NetAddress) -> Self
fn from(value: NetAddress) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for NetAddress
impl From<SocketAddr> for NetAddress
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl FromStr for NetAddress
impl FromStr for NetAddress
Source§impl Hash for NetAddress
impl Hash for NetAddress
Source§impl PartialEq for NetAddress
impl PartialEq for NetAddress
Source§impl Serialize for NetAddress
impl Serialize for NetAddress
impl Copy for NetAddress
impl Eq for NetAddress
impl StructuralPartialEq for NetAddress
Auto Trait Implementations§
impl Freeze for NetAddress
impl RefUnwindSafe for NetAddress
impl Send for NetAddress
impl Sync for NetAddress
impl Unpin for NetAddress
impl UnwindSafe for NetAddress
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more