Enum message_io::network::RemoteAddr [−][src]
pub enum RemoteAddr {
Socket(SocketAddr),
Str(String),
}
Expand description
An struct that contains a remote address.
It can be Either, a SocketAddr
as usual or a String
used for protocols
that needs more than a SocketAddr
to get connected (e.g. WebSocket)
It is usually used in
NetworkController::connect()
to specify the remote address.
Variants
Socket(SocketAddr)
Tuple Fields of Socket
0: SocketAddr
Str(String)
Tuple Fields of Str
0: String
Implementations
Check if the RemoteAddr
is a SocketAddr
.
Extract the SocketAddr
.
This function panics if the RemoteAddr
do not represent a SocketAddr
.
Trait Implementations
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Iter = IntoIter<SocketAddr>
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. Read more
Converts this object to an iterator of resolved SocketAddr
s. Read more
Auto Trait Implementations
impl RefUnwindSafe for RemoteAddr
impl Send for RemoteAddr
impl Sync for RemoteAddr
impl Unpin for RemoteAddr
impl UnwindSafe for RemoteAddr
Blanket Implementations
Mutably borrows from an owned value. Read more