pub struct ContextualNetAddress { /* private fields */ }Expand description
A network address possibly without explicit port.
Use normalize to get a fully determined address.
Implementations§
Source§impl ContextualNetAddress
impl ContextualNetAddress
pub fn new(ip: IpAddress, port: Option<u16>) -> Self
pub fn has_port(&self) -> bool
pub fn normalize(&self, default_port: u16) -> NetAddress
pub fn unspecified() -> Self
pub fn loopback() -> Self
pub fn port_not_specified(&self) -> bool
pub fn with_port(&self, port: u16) -> Self
Trait Implementations§
Source§impl BorshDeserialize for ContextualNetAddress
impl BorshDeserialize for ContextualNetAddress
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 Clone for ContextualNetAddress
impl Clone for ContextualNetAddress
Source§fn clone(&self) -> ContextualNetAddress
fn clone(&self) -> ContextualNetAddress
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 ContextualNetAddress
impl Debug for ContextualNetAddress
Source§impl<'de> Deserialize<'de> for ContextualNetAddress
impl<'de> Deserialize<'de> for ContextualNetAddress
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 ContextualNetAddress
impl Display for ContextualNetAddress
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 FromStr for ContextualNetAddress
impl FromStr for ContextualNetAddress
Source§impl Hash for ContextualNetAddress
impl Hash for ContextualNetAddress
Source§impl PartialEq for ContextualNetAddress
impl PartialEq for ContextualNetAddress
Source§impl Serialize for ContextualNetAddress
impl Serialize for ContextualNetAddress
Source§impl TryFrom<&str> for ContextualNetAddress
impl TryFrom<&str> for ContextualNetAddress
Source§impl TryFrom<String> for ContextualNetAddress
impl TryFrom<String> for ContextualNetAddress
impl Copy for ContextualNetAddress
impl Eq for ContextualNetAddress
impl StructuralPartialEq for ContextualNetAddress
Auto Trait Implementations§
impl Freeze for ContextualNetAddress
impl RefUnwindSafe for ContextualNetAddress
impl Send for ContextualNetAddress
impl Sync for ContextualNetAddress
impl Unpin for ContextualNetAddress
impl UnwindSafe for ContextualNetAddress
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