Struct HostWithOptPort
pub struct HostWithOptPort {
pub host: Host,
pub port: Option<u16>,
}net only.Expand description
Fields§
§host: Host§port: Option<u16>Implementations§
§impl HostWithOptPort
impl HostWithOptPort
pub const fn new(host: Host) -> HostWithOptPort
pub const fn new(host: Host) -> HostWithOptPort
Creates a new HostWithOptPort from a Host.
pub const fn new_with_port(host: Host, port: u16) -> HostWithOptPort
pub const fn new_with_port(host: Host, port: u16) -> HostWithOptPort
Creates a new HostWithOptPort from a Host and port.
pub const fn local_ipv4() -> HostWithOptPort
pub const fn local_ipv4() -> HostWithOptPort
creates a new local ipv4 HostWithOptPort without a port.
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::local_ipv4();
assert_eq!("127.0.0.1", addr.to_string());pub const fn local_ipv4_with_port(port: u16) -> HostWithOptPort
pub const fn local_ipv4_with_port(port: u16) -> HostWithOptPort
creates a new local ipv4 HostWithOptPort with the given port
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::local_ipv4_with_port(8080);
assert_eq!("127.0.0.1:8080", addr.to_string());pub const fn local_ipv6() -> HostWithOptPort
pub const fn local_ipv6() -> HostWithOptPort
creates a new local ipv6 HostWithOptPort without a port.
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::local_ipv6();
assert_eq!("::1", addr.to_string());pub const fn local_ipv6_with_port(port: u16) -> HostWithOptPort
pub const fn local_ipv6_with_port(port: u16) -> HostWithOptPort
creates a new local ipv6 HostWithOptPort with the given port.
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::local_ipv6_with_port(8080);
assert_eq!("[::1]:8080", addr.to_string());pub const fn default_ipv4() -> HostWithOptPort
pub const fn default_ipv4() -> HostWithOptPort
creates a default ipv4 HostWithOptPort without a port
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::default_ipv4_with_port(8080);
assert_eq!("0.0.0.0:8080", addr.to_string());pub const fn default_ipv4_with_port(port: u16) -> HostWithOptPort
pub const fn default_ipv4_with_port(port: u16) -> HostWithOptPort
creates a default ipv4 HostWithOptPort with the given port
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::default_ipv4_with_port(8080);
assert_eq!("0.0.0.0:8080", addr.to_string());pub const fn default_ipv6() -> HostWithOptPort
pub const fn default_ipv6() -> HostWithOptPort
creates a new default ipv6 HostWithOptPort without a port.
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::default_ipv6();
assert_eq!("::", addr.to_string());pub const fn default_ipv6_with_port(port: u16) -> HostWithOptPort
pub const fn default_ipv6_with_port(port: u16) -> HostWithOptPort
creates a new default ipv6 HostWithOptPort with the given port.
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::default_ipv6_with_port(8080);
assert_eq!("[::]:8080", addr.to_string());pub const fn broadcast_ipv4() -> HostWithOptPort
pub const fn broadcast_ipv4() -> HostWithOptPort
creates a new broadcast ipv4 HostWithOptPort without a port
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::broadcast_ipv4();
assert_eq!("255.255.255.255", addr.to_string());pub const fn broadcast_ipv4_with_port(port: u16) -> HostWithOptPort
pub const fn broadcast_ipv4_with_port(port: u16) -> HostWithOptPort
creates a new broadcast ipv4 HostWithOptPort with the given port
§Example
use rama_net::address::HostWithOptPort;
let addr = HostWithOptPort::broadcast_ipv4_with_port(8080);
assert_eq!("255.255.255.255:8080", addr.to_string());pub const fn example_domain() -> HostWithOptPort
pub const fn example_domain() -> HostWithOptPort
Creates a new example domain HostWithOptPort without a port.
pub const fn example_domain_http() -> HostWithOptPort
pub const fn example_domain_http() -> HostWithOptPort
Creates a new example domain HostWithOptPort for the http default port.
pub const fn example_domain_https() -> HostWithOptPort
pub const fn example_domain_https() -> HostWithOptPort
Creates a new example domain HostWithOptPort for the https default port.
pub const fn example_domain_with_port(port: u16) -> HostWithOptPort
pub const fn example_domain_with_port(port: u16) -> HostWithOptPort
Creates a new example domain HostWithOptPort for the given port.
pub const fn localhost_domain() -> HostWithOptPort
pub const fn localhost_domain() -> HostWithOptPort
Creates a new localhost domain HostWithOptPort without a port.
pub const fn localhost_domain_http() -> HostWithOptPort
pub const fn localhost_domain_http() -> HostWithOptPort
Creates a new localhost domain HostWithOptPort for the http default port.
pub const fn localhost_domain_https() -> HostWithOptPort
pub const fn localhost_domain_https() -> HostWithOptPort
Creates a new localhost domain HostWithOptPort for the https default port.
pub const fn localhost_domain_with_port(port: u16) -> HostWithOptPort
pub const fn localhost_domain_with_port(port: u16) -> HostWithOptPort
Creates a new localhost domain HostWithOptPort for the given port.
pub fn with_host(self, host: Host) -> HostWithOptPort
pub fn with_host(self, host: Host) -> HostWithOptPort
Set Host of HostWithOptPort
pub fn set_host(&mut self, host: Host) -> &mut HostWithOptPort
pub fn set_host(&mut self, host: Host) -> &mut HostWithOptPort
Set Host of HostWithOptPort
pub fn maybe_with_port(self, port: Option<u16>) -> HostWithOptPort
pub fn maybe_with_port(self, port: Option<u16>) -> HostWithOptPort
(un)set port (u16) of HostWithOptPort
pub fn maybe_set_port(&mut self, port: Option<u16>) -> &mut HostWithOptPort
pub fn maybe_set_port(&mut self, port: Option<u16>) -> &mut HostWithOptPort
(un)set port (u16) of HostWithOptPort
pub fn with_port(self, port: u16) -> HostWithOptPort
pub fn with_port(self, port: u16) -> HostWithOptPort
(un)set port (u16) of HostWithOptPort
pub fn set_port(&mut self, port: u16) -> &mut HostWithOptPort
pub fn set_port(&mut self, port: u16) -> &mut HostWithOptPort
(un)set port (u16) of HostWithOptPort
pub fn without_port(self) -> HostWithOptPort
pub fn without_port(self) -> HostWithOptPort
(un)set port (u16) of HostWithOptPort
pub fn unset_port(&mut self) -> &mut HostWithOptPort
pub fn unset_port(&mut self) -> &mut HostWithOptPort
(un)set port (u16) of HostWithOptPort
Trait Implementations§
§impl Clone for HostWithOptPort
impl Clone for HostWithOptPort
§fn clone(&self) -> HostWithOptPort
fn clone(&self) -> HostWithOptPort
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HostWithOptPort
impl Debug for HostWithOptPort
§impl<'de> Deserialize<'de> for HostWithOptPort
impl<'de> Deserialize<'de> for HostWithOptPort
§fn deserialize<D>(
deserializer: D,
) -> Result<HostWithOptPort, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<HostWithOptPort, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for HostWithOptPort
impl Display for HostWithOptPort
§impl From<&SocketAddr> for HostWithOptPort
impl From<&SocketAddr> for HostWithOptPort
§fn from(addr: &SocketAddr) -> HostWithOptPort
fn from(addr: &SocketAddr) -> HostWithOptPort
§impl From<&SocketAddress> for HostWithOptPort
impl From<&SocketAddress> for HostWithOptPort
§fn from(addr: &SocketAddress) -> HostWithOptPort
fn from(addr: &SocketAddress) -> HostWithOptPort
§impl From<(Domain, u16)> for HostWithOptPort
impl From<(Domain, u16)> for HostWithOptPort
§fn from(_: (Domain, u16)) -> HostWithOptPort
fn from(_: (Domain, u16)) -> HostWithOptPort
§impl From<(Host, u16)> for HostWithOptPort
impl From<(Host, u16)> for HostWithOptPort
§fn from(_: (Host, u16)) -> HostWithOptPort
fn from(_: (Host, u16)) -> HostWithOptPort
§impl From<(IpAddr, u16)> for HostWithOptPort
impl From<(IpAddr, u16)> for HostWithOptPort
§fn from(_: (IpAddr, u16)) -> HostWithOptPort
fn from(_: (IpAddr, u16)) -> HostWithOptPort
§impl From<(Ipv4Addr, u16)> for HostWithOptPort
impl From<(Ipv4Addr, u16)> for HostWithOptPort
§fn from(_: (Ipv4Addr, u16)) -> HostWithOptPort
fn from(_: (Ipv4Addr, u16)) -> HostWithOptPort
§impl From<(Ipv6Addr, u16)> for HostWithOptPort
impl From<(Ipv6Addr, u16)> for HostWithOptPort
§fn from(_: (Ipv6Addr, u16)) -> HostWithOptPort
fn from(_: (Ipv6Addr, u16)) -> HostWithOptPort
§impl From<Authority> for HostWithOptPort
impl From<Authority> for HostWithOptPort
§fn from(addr: Authority) -> HostWithOptPort
fn from(addr: Authority) -> HostWithOptPort
§impl From<DomainAddress> for HostWithOptPort
impl From<DomainAddress> for HostWithOptPort
§fn from(addr: DomainAddress) -> HostWithOptPort
fn from(addr: DomainAddress) -> HostWithOptPort
§impl From<Host> for HostWithOptPort
impl From<Host> for HostWithOptPort
§fn from(host: Host) -> HostWithOptPort
fn from(host: Host) -> HostWithOptPort
§impl From<Host> for HostWithOptPort
impl From<Host> for HostWithOptPort
§fn from(host: Host) -> HostWithOptPort
fn from(host: Host) -> HostWithOptPort
§impl From<HostWithOptPort> for Authority
impl From<HostWithOptPort> for Authority
§fn from(addr: HostWithOptPort) -> Authority
fn from(addr: HostWithOptPort) -> Authority
§impl From<HostWithOptPort> for ForwardedAuthority
impl From<HostWithOptPort> for ForwardedAuthority
§fn from(value: HostWithOptPort) -> ForwardedAuthority
fn from(value: HostWithOptPort) -> ForwardedAuthority
§impl From<HostWithOptPort> for Host
impl From<HostWithOptPort> for Host
§fn from(hwop: HostWithOptPort) -> Host
fn from(hwop: HostWithOptPort) -> Host
§impl From<HostWithOptPort> for Host
impl From<HostWithOptPort> for Host
§fn from(addr: HostWithOptPort) -> Host
fn from(addr: HostWithOptPort) -> Host
§impl From<HostWithOptPort> for NodeId
impl From<HostWithOptPort> for NodeId
§fn from(value: HostWithOptPort) -> NodeId
fn from(value: HostWithOptPort) -> NodeId
§impl From<HostWithPort> for HostWithOptPort
impl From<HostWithPort> for HostWithOptPort
§fn from(addr: HostWithPort) -> HostWithOptPort
fn from(addr: HostWithPort) -> HostWithOptPort
§impl From<SocketAddr> for HostWithOptPort
impl From<SocketAddr> for HostWithOptPort
§fn from(addr: SocketAddr) -> HostWithOptPort
fn from(addr: SocketAddr) -> HostWithOptPort
§impl From<SocketAddress> for HostWithOptPort
impl From<SocketAddress> for HostWithOptPort
§fn from(addr: SocketAddress) -> HostWithOptPort
fn from(addr: SocketAddress) -> HostWithOptPort
§impl FromStr for HostWithOptPort
impl FromStr for HostWithOptPort
§type Err = OpaqueError
type Err = OpaqueError
§fn from_str(
s: &str,
) -> Result<HostWithOptPort, <HostWithOptPort as FromStr>::Err>
fn from_str( s: &str, ) -> Result<HostWithOptPort, <HostWithOptPort as FromStr>::Err>
s to return a value of this type. Read more§impl Hash for HostWithOptPort
impl Hash for HostWithOptPort
§impl PartialEq for HostWithOptPort
impl PartialEq for HostWithOptPort
§impl Serialize for HostWithOptPort
impl Serialize for HostWithOptPort
§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 HostWithOptPort
impl TryFrom<&[u8]> for HostWithOptPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
bytes: &[u8],
) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<&[u8]>>::Error>
fn try_from( bytes: &[u8], ) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<&[u8]>>::Error>
§impl TryFrom<&str> for HostWithOptPort
impl TryFrom<&str> for HostWithOptPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
s: &str,
) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<&str>>::Error>
§impl TryFrom<String> for HostWithOptPort
impl TryFrom<String> for HostWithOptPort
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
s: String,
) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<String>>::Error>
fn try_from( s: String, ) -> Result<HostWithOptPort, <HostWithOptPort as TryFrom<String>>::Error>
§impl TryFrom<Vec<u8>> for HostWithOptPort
impl TryFrom<Vec<u8>> for HostWithOptPort
§type Error = OpaqueError
type Error = OpaqueError
impl Eq for HostWithOptPort
impl StructuralPartialEq for HostWithOptPort
Auto Trait Implementations§
impl Freeze for HostWithOptPort
impl RefUnwindSafe for HostWithOptPort
impl Send for HostWithOptPort
impl Sync for HostWithOptPort
impl Unpin for HostWithOptPort
impl UnwindSafe for HostWithOptPort
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.