pub struct PortNumber(/* private fields */);Expand description
A validated TCP/UDP/SCTP port number.
Implementations§
Source§impl PortNumber
impl PortNumber
Sourcepub const fn new(value: u16) -> Result<PortNumber, PortMappingError>
pub const fn new(value: u16) -> Result<PortNumber, PortMappingError>
Creates a port number in 1..=65535.
Trait Implementations§
Source§impl Clone for PortNumber
impl Clone for PortNumber
Source§fn clone(&self) -> PortNumber
fn clone(&self) -> PortNumber
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortNumber
impl Debug for PortNumber
Source§impl Display for PortNumber
impl Display for PortNumber
Source§impl Hash for PortNumber
impl Hash for PortNumber
Source§impl Ord for PortNumber
impl Ord for PortNumber
Source§fn cmp(&self, other: &PortNumber) -> Ordering
fn cmp(&self, other: &PortNumber) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PortNumber
impl PartialEq for PortNumber
Source§fn eq(&self, other: &PortNumber) -> bool
fn eq(&self, other: &PortNumber) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PortNumber
impl PartialOrd for PortNumber
impl Copy for PortNumber
impl Eq for PortNumber
impl StructuralPartialEq for PortNumber
Auto Trait Implementations§
impl Freeze for PortNumber
impl RefUnwindSafe for PortNumber
impl Send for PortNumber
impl Sync for PortNumber
impl Unpin for PortNumber
impl UnsafeUnpin for PortNumber
impl UnwindSafe for PortNumber
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