pub struct BridgeAddr(/* private fields */);
Expand description
An address of a bridge, for use in configuration.
Contains precisely, either:
- A hostname (as a string), plus a
u16
port; or - An (IPv4 or IPv6) socket address including port - i.e., a
SocketAddr
, or to put it another way, an IP address (v4 or v6) plus au16
port.
Hostnames which are not syntactically invalid Internet hostnames,
and a port value of zero,
can be represented within a BridgeAddr
.
Implementations§
Source§impl BridgeAddr
impl BridgeAddr
Sourcepub fn new_addr_from_sockaddr(sa: SocketAddr) -> Self
pub fn new_addr_from_sockaddr(sa: SocketAddr) -> Self
Create a new BridgeAddr
referring to a numeric address and port
Sourcepub fn as_socketaddr(&self) -> Option<&SocketAddr>
pub fn as_socketaddr(&self) -> Option<&SocketAddr>
If this is a numeric address, return it as a SocketAddr
Sourcepub fn new_named_host_port(hostname: impl Into<String>, port: u16) -> Self
pub fn new_named_host_port(hostname: impl Into<String>, port: u16) -> Self
Create a new BridgeAddr
referring to a numeric address and port
Sourcepub fn as_host_port(&self) -> Option<(&str, u16)>
pub fn as_host_port(&self) -> Option<(&str, u16)>
If this is a named host and port, return it as hostname string and port
Trait Implementations§
Source§impl Clone for BridgeAddr
impl Clone for BridgeAddr
Source§fn clone(&self) -> BridgeAddr
fn clone(&self) -> BridgeAddr
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 BridgeAddr
impl Debug for BridgeAddr
Source§impl<'de> Deserialize<'de> for BridgeAddr
impl<'de> Deserialize<'de> for BridgeAddr
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 BridgeAddr
impl Display for BridgeAddr
Source§impl FromStr for BridgeAddr
impl FromStr for BridgeAddr
Source§impl Hash for BridgeAddr
impl Hash for BridgeAddr
Source§impl PartialEq for BridgeAddr
impl PartialEq for BridgeAddr
Source§impl Redactable for BridgeAddr
impl Redactable for BridgeAddr
Source§fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
As
Display::fmt
, but produce a redacted representation.Source§fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result<(), Error>
As
Debug::fmt
, but produce a redacted representation.Source§fn redacted(&self) -> Redacted<&Self>
fn redacted(&self) -> Redacted<&Self>
Return a smart pointer that will display or debug this object as its
redacted form.
Source§fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
Return a smart pointer that redacts this object if
redact
is true.Source§impl Serialize for BridgeAddrwhere
Self: Display,
impl Serialize for BridgeAddrwhere
Self: Display,
impl Eq for BridgeAddr
impl StructuralPartialEq for BridgeAddr
Auto Trait Implementations§
impl Freeze for BridgeAddr
impl RefUnwindSafe for BridgeAddr
impl Send for BridgeAddr
impl Sync for BridgeAddr
impl Unpin for BridgeAddr
impl UnwindSafe for BridgeAddr
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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