pub struct PortRange {
pub start: u16,
pub end: Option<u16>,
}
Expand description
Represents some range of ports
Fields§
§start: u16
§end: Option<u16>
Implementations§
Source§impl PortRange
impl PortRange
Sourcepub fn make_socket_addrs(&self, addr: impl Into<IpAddr>) -> Vec<SocketAddr>
pub fn make_socket_addrs(&self, addr: impl Into<IpAddr>) -> Vec<SocketAddr>
Builds a collection of SocketAddr
instances from the port range and given ip address
Sourcepub fn is_ephemeral(&self) -> bool
pub fn is_ephemeral(&self) -> bool
Returns true if port range represents the ephemeral port.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PortRange
impl<'de> Deserialize<'de> for PortRange
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 From<RangeInclusive<u16>> for PortRange
impl From<RangeInclusive<u16>> for PortRange
Source§fn from(r: RangeInclusive<u16>) -> Self
fn from(r: RangeInclusive<u16>) -> Self
Converts to this type from the input type.
Source§impl<'a> IntoIterator for &'a PortRange
impl<'a> IntoIterator for &'a PortRange
Source§impl IntoIterator for PortRange
impl IntoIterator for PortRange
impl Copy for PortRange
impl Eq for PortRange
impl StructuralPartialEq for PortRange
Auto Trait Implementations§
impl Freeze for PortRange
impl RefUnwindSafe for PortRange
impl Send for PortRange
impl Sync for PortRange
impl Unpin for PortRange
impl UnwindSafe for PortRange
Blanket Implementations§
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