pub enum NetworkSize {
V4(u32),
V6(u128),
}
Expand description
Represents a generic network size.
IPv4 network sizes are represented as u32
values, while IPv6 network sizes are represented as u128
values.
§Comparisons
Network sizes are compared by value, not by type.
use ipnetwork::NetworkSize;
let ns1 = NetworkSize::V4(100);
let ns2 = NetworkSize::V6(100);
assert_eq!(ns1, ns2);
Variants§
Trait Implementations§
Source§impl Clone for NetworkSize
impl Clone for NetworkSize
Source§fn clone(&self) -> NetworkSize
fn clone(&self) -> NetworkSize
Returns a copy of the value. Read more
1.0.0 · 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 NetworkSize
impl Debug for NetworkSize
Source§impl Display for NetworkSize
impl Display for NetworkSize
Source§impl From<NetworkSize> for u128
impl From<NetworkSize> for u128
Source§fn from(val: NetworkSize) -> Self
fn from(val: NetworkSize) -> Self
Converts to this type from the input type.
Source§impl From<u128> for NetworkSize
impl From<u128> for NetworkSize
Source§impl From<u32> for NetworkSize
impl From<u32> for NetworkSize
Source§impl Hash for NetworkSize
impl Hash for NetworkSize
Source§impl Ord for NetworkSize
impl Ord for NetworkSize
Source§impl PartialEq for NetworkSize
impl PartialEq for NetworkSize
Source§impl PartialOrd for NetworkSize
impl PartialOrd for NetworkSize
Source§impl TryFrom<NetworkSize> for u32
impl TryFrom<NetworkSize> for u32
Source§type Error = NetworkSizeError
type Error = NetworkSizeError
The type returned in the event of a conversion error.
impl Copy for NetworkSize
impl Eq for NetworkSize
Auto Trait Implementations§
impl Freeze for NetworkSize
impl RefUnwindSafe for NetworkSize
impl Send for NetworkSize
impl Sync for NetworkSize
impl Unpin for NetworkSize
impl UnwindSafe for NetworkSize
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