Struct rustful::server::Host
[−]
[src]
pub struct Host(_);
A host address and a port.
Can be conveniently converted from an existing address-port pair or just a port:
use std::net::Ipv4Addr; use rustful::server::Host; let host1: Host = (Ipv4Addr::new(0, 0, 0, 0), 80).into(); let host2: Host = 80.into(); assert_eq!(host1, host2);
Methods
impl Host
[src]
impl Host
pub fn any_v4(port: u16) -> Host
[src]
pub fn any_v4(port: u16) -> Host
Create a Host
with the address 0.0.0.0:port
. This is the same as port.into()
.
pub fn port(&mut self, port: u16)
[src]
pub fn port(&mut self, port: u16)
Change the port of the host address.
Trait Implementations
impl Eq for Host
[src]
impl Eq for Host
impl PartialEq for Host
[src]
impl PartialEq for Host
fn eq(&self, __arg_0: &Host) -> bool
[src]
fn eq(&self, __arg_0: &Host) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Host) -> bool
[src]
fn ne(&self, __arg_0: &Host) -> bool
This method tests for !=
.
impl Debug for Host
[src]
impl Debug for Host
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for Host
[src]
impl Hash for Host
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for Host
[src]
impl Clone for Host
fn clone(&self) -> Host
[src]
fn clone(&self) -> Host
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Host
[src]
impl Copy for Host
impl From<Host> for SocketAddr
[src]
impl From<Host> for SocketAddr
fn from(host: Host) -> SocketAddr
[src]
fn from(host: Host) -> SocketAddr
Performs the conversion.
impl From<u16> for Host
[src]
impl From<u16> for Host
impl From<SocketAddr> for Host
[src]
impl From<SocketAddr> for Host
fn from(addr: SocketAddr) -> Host
[src]
fn from(addr: SocketAddr) -> Host
Performs the conversion.
impl From<SocketAddrV4> for Host
[src]
impl From<SocketAddrV4> for Host
fn from(addr: SocketAddrV4) -> Host
[src]
fn from(addr: SocketAddrV4) -> Host
Performs the conversion.
impl From<SocketAddrV6> for Host
[src]
impl From<SocketAddrV6> for Host
fn from(addr: SocketAddrV6) -> Host
[src]
fn from(addr: SocketAddrV6) -> Host
Performs the conversion.
impl From<(Ipv4Addr, u16)> for Host
[src]
impl From<(Ipv4Addr, u16)> for Host
impl FromStr for Host
[src]
impl FromStr for Host