Struct kaspa_utils::networking::NetAddress
source · 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
source§impl BorshSchema for NetAddress
impl BorshSchema for NetAddress
source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
source§fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively( definitions: &mut HashMap<Declaration, Definition> )
Recursively, using DFS, add type definitions required for this type. For primitive types
this is an empty map. Type definition explains how to serialize/deserialize a type.
source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition> )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
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 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 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§fn eq(&self, other: &NetAddress) -> bool
fn eq(&self, other: &NetAddress) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for NetAddress
impl Serialize for NetAddress
impl Copy for NetAddress
impl Eq for NetAddress
impl StructuralEq for NetAddress
impl StructuralPartialEq for NetAddress
Auto Trait Implementations§
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