Struct HostWithPort
pub struct HostWithPort {
pub host: Host,
pub port: u16,
}net only.Fields§
§host: Host§port: u16Implementations§
§impl HostWithPort
impl HostWithPort
pub const fn new(host: Host, port: u16) -> HostWithPort
pub const fn new(host: Host, port: u16) -> HostWithPort
Creates a new HostWithPort.
pub const fn local_ipv4(port: u16) -> HostWithPort
pub const fn local_ipv4(port: u16) -> HostWithPort
creates a new local ipv4 HostWithPort for the given port
§Example
use rama_net::address::HostWithPort;
let addr = HostWithPort::local_ipv4(8080);
assert_eq!("127.0.0.1:8080", addr.to_string());pub const fn local_ipv6(port: u16) -> HostWithPort
pub const fn local_ipv6(port: u16) -> HostWithPort
creates a new local ipv6 HostWithPort for the given port.
§Example
use rama_net::address::HostWithPort;
let addr = HostWithPort::local_ipv6(8080);
assert_eq!("[::1]:8080", addr.to_string());pub const fn default_ipv4(port: u16) -> HostWithPort
pub const fn default_ipv4(port: u16) -> HostWithPort
creates a new default ipv4 HostWithPort for the given port
§Example
use rama_net::address::HostWithPort;
let addr = HostWithPort::default_ipv4(8080);
assert_eq!("0.0.0.0:8080", addr.to_string());pub const fn default_ipv6(port: u16) -> HostWithPort
pub const fn default_ipv6(port: u16) -> HostWithPort
creates a new default ipv6 HostWithPort for the given port.
§Example
use rama_net::address::HostWithPort;
let addr = HostWithPort::default_ipv6(8080);
assert_eq!("[::]:8080", addr.to_string());pub const fn broadcast_ipv4(port: u16) -> HostWithPort
pub const fn broadcast_ipv4(port: u16) -> HostWithPort
creates a new broadcast ipv4 HostWithPort for the given port
§Example
use rama_net::address::HostWithPort;
let addr = HostWithPort::broadcast_ipv4(8080);
assert_eq!("255.255.255.255:8080", addr.to_string());pub const fn example_domain_http() -> HostWithPort
pub const fn example_domain_http() -> HostWithPort
Creates a new example domain HostWithPort for the http default port.
pub const fn example_domain_https() -> HostWithPort
pub const fn example_domain_https() -> HostWithPort
Creates a new example HostWithPort for the https default port.
pub const fn example_domain_with_port(port: u16) -> HostWithPort
pub const fn example_domain_with_port(port: u16) -> HostWithPort
Creates a new example HostWithPort for the given port.
pub const fn localhost_domain_http() -> HostWithPort
pub const fn localhost_domain_http() -> HostWithPort
Creates a new localhost HostWithPort for the http default port.
pub const fn localhost_domain_https() -> HostWithPort
pub const fn localhost_domain_https() -> HostWithPort
Creates a new localhost HostWithPort for the https default port.
pub const fn localhost_domain_with_port(port: u16) -> HostWithPort
pub const fn localhost_domain_with_port(port: u16) -> HostWithPort
Creates a new localhost DomainAddress for the given port.
pub fn with_host(self, host: Host) -> HostWithPort
pub fn with_host(self, host: Host) -> HostWithPort
Set Host of HostWithPort
pub fn set_host(&mut self, host: Host) -> &mut HostWithPort
pub fn set_host(&mut self, host: Host) -> &mut HostWithPort
Set Host of HostWithPort
pub fn with_port(self, port: u16) -> HostWithPort
pub fn with_port(self, port: u16) -> HostWithPort
Set port (u16) of HostWithPort
pub fn set_port(&mut self, port: u16) -> &mut HostWithPort
pub fn set_port(&mut self, port: u16) -> &mut HostWithPort
Set port (u16) of HostWithPort
Trait Implementations§
§impl Clone for HostWithPort
impl Clone for HostWithPort
§fn clone(&self) -> HostWithPort
fn clone(&self) -> HostWithPort
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HostWithPort
impl Debug for HostWithPort
§impl<'de> Deserialize<'de> for HostWithPort
impl<'de> Deserialize<'de> for HostWithPort
§fn deserialize<D>(
deserializer: D,
) -> Result<HostWithPort, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<HostWithPort, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for HostWithPort
impl Display for HostWithPort
§impl From<&SocketAddr> for HostWithPort
impl From<&SocketAddr> for HostWithPort
§fn from(addr: &SocketAddr) -> HostWithPort
fn from(addr: &SocketAddr) -> HostWithPort
§impl From<&SocketAddress> for HostWithPort
impl From<&SocketAddress> for HostWithPort
§fn from(addr: &SocketAddress) -> HostWithPort
fn from(addr: &SocketAddress) -> HostWithPort
§impl From<(Domain, u16)> for HostWithPort
impl From<(Domain, u16)> for HostWithPort
§fn from(_: (Domain, u16)) -> HostWithPort
fn from(_: (Domain, u16)) -> HostWithPort
§impl From<(Host, u16)> for HostWithPort
impl From<(Host, u16)> for HostWithPort
§fn from(_: (Host, u16)) -> HostWithPort
fn from(_: (Host, u16)) -> HostWithPort
§impl From<(IpAddr, u16)> for HostWithPort
impl From<(IpAddr, u16)> for HostWithPort
§fn from(_: (IpAddr, u16)) -> HostWithPort
fn from(_: (IpAddr, u16)) -> HostWithPort
§impl From<(Ipv4Addr, u16)> for HostWithPort
impl From<(Ipv4Addr, u16)> for HostWithPort
§fn from(_: (Ipv4Addr, u16)) -> HostWithPort
fn from(_: (Ipv4Addr, u16)) -> HostWithPort
§impl From<(Ipv6Addr, u16)> for HostWithPort
impl From<(Ipv6Addr, u16)> for HostWithPort
§fn from(_: (Ipv6Addr, u16)) -> HostWithPort
fn from(_: (Ipv6Addr, u16)) -> HostWithPort
§impl From<DomainAddress> for HostWithPort
impl From<DomainAddress> for HostWithPort
§fn from(addr: DomainAddress) -> HostWithPort
fn from(addr: DomainAddress) -> HostWithPort
§impl From<HostWithPort> for Authority
impl From<HostWithPort> for Authority
§fn from(addr: HostWithPort) -> Authority
fn from(addr: HostWithPort) -> Authority
§impl From<HostWithPort> for ForwardedAuthority
impl From<HostWithPort> for ForwardedAuthority
§fn from(value: HostWithPort) -> ForwardedAuthority
fn from(value: HostWithPort) -> ForwardedAuthority
§impl From<HostWithPort> for Host
impl From<HostWithPort> for Host
§fn from(hwp: HostWithPort) -> Host
fn from(hwp: HostWithPort) -> Host
§impl From<HostWithPort> for Host
impl From<HostWithPort> for Host
§fn from(addr: HostWithPort) -> Host
fn from(addr: HostWithPort) -> Host
§impl From<HostWithPort> for HostWithOptPort
impl From<HostWithPort> for HostWithOptPort
§fn from(addr: HostWithPort) -> HostWithOptPort
fn from(addr: HostWithPort) -> HostWithOptPort
§impl From<HostWithPort> for NodeId
impl From<HostWithPort> for NodeId
§fn from(value: HostWithPort) -> NodeId
fn from(value: HostWithPort) -> NodeId
§impl From<SocketAddr> for HostWithPort
impl From<SocketAddr> for HostWithPort
§fn from(addr: SocketAddr) -> HostWithPort
fn from(addr: SocketAddr) -> HostWithPort
§impl From<SocketAddress> for HostWithPort
impl From<SocketAddress> for HostWithPort
§fn from(addr: SocketAddress) -> HostWithPort
fn from(addr: SocketAddress) -> HostWithPort
§impl FromStr for HostWithPort
impl FromStr for HostWithPort
§type Err = OpaqueError
type Err = OpaqueError
§fn from_str(s: &str) -> Result<HostWithPort, <HostWithPort as FromStr>::Err>
fn from_str(s: &str) -> Result<HostWithPort, <HostWithPort as FromStr>::Err>
s to return a value of this type. Read more§impl Hash for HostWithPort
impl Hash for HostWithPort
§impl PartialEq for HostWithPort
impl PartialEq for HostWithPort
§impl Serialize for HostWithPort
impl Serialize for HostWithPort
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
§impl TryFrom<&[u8]> for HostWithPort
impl TryFrom<&[u8]> for HostWithPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
bytes: &[u8],
) -> Result<HostWithPort, <HostWithPort as TryFrom<&[u8]>>::Error>
fn try_from( bytes: &[u8], ) -> Result<HostWithPort, <HostWithPort as TryFrom<&[u8]>>::Error>
§impl TryFrom<&str> for HostWithPort
impl TryFrom<&str> for HostWithPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
s: &str,
) -> Result<HostWithPort, <HostWithPort as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<HostWithPort, <HostWithPort as TryFrom<&str>>::Error>
§impl TryFrom<String> for HostWithPort
impl TryFrom<String> for HostWithPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
s: String,
) -> Result<HostWithPort, <HostWithPort as TryFrom<String>>::Error>
fn try_from( s: String, ) -> Result<HostWithPort, <HostWithPort as TryFrom<String>>::Error>
§impl TryFrom<Vec<u8>> for HostWithPort
impl TryFrom<Vec<u8>> for HostWithPort
§type Error = OpaqueError
type Error = OpaqueError
impl Eq for HostWithPort
impl StructuralPartialEq for HostWithPort
Auto Trait Implementations§
impl Freeze for HostWithPort
impl RefUnwindSafe for HostWithPort
impl Send for HostWithPort
impl Sync for HostWithPort
impl Unpin for HostWithPort
impl UnwindSafe for HostWithPort
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
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
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.