Struct pocket_relay_core::blaze::codec::NetAddress
source · pub struct NetAddress(pub u32);Expand description
Structure for wrapping a Blaze networking address
Tuple Fields§
§0: u32Implementations§
source§impl NetAddress
impl NetAddress
sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Addresses where the value is zero are considered to be invalid addresses that could not be parsed. Parsing these addresses would result in the address 0.0.0.0
sourcepub fn from_ipv4(value: &str) -> NetAddress
pub fn from_ipv4(value: &str) -> NetAddress
Converts the provided IPv4 string into a NetAddress
sourcepub fn try_from_ipv4(value: &str) -> Option<NetAddress>
pub fn try_from_ipv4(value: &str) -> Option<NetAddress>
Attempts to convert the provided IP address string into a NetAddress value. If the value is not a valid IPv4 address then None will be returned.
Trait Implementations§
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
Debug trait implementation sample implementation as the Display implementation so that is just called instead
source§impl Decodable for NetAddress
impl Decodable for NetAddress
source§impl Default for NetAddress
impl Default for NetAddress
source§fn default() -> NetAddress
fn default() -> NetAddress
Returns the “default value” for a type. Read more
source§impl Display for NetAddress
impl Display for NetAddress
Display trait implementation for NetAddress. If the value is valid the value is translated into the IPv4 representation
source§impl Encodable for NetAddress
impl Encodable for NetAddress
source§impl PartialEq<NetAddress> for NetAddress
impl PartialEq<NetAddress> for NetAddress
source§fn eq(&self, other: &NetAddress) -> bool
fn eq(&self, other: &NetAddress) -> bool
source§impl Serialize for NetAddress
impl Serialize for NetAddress
Serialization implementation for NetAddress which uses the IPv4 representation implemented in Display
source§impl ValueType for NetAddress
impl ValueType for NetAddress
source§fn value_type() -> TdfType
fn value_type() -> TdfType
The type of tdf value this is
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.