Enum net_types::ip::Ipv4

source ·
pub enum Ipv4 {}
Expand description

IPv4.

Ipv4 implements Ip for IPv4.

Note that this type has no value constructor. It is used purely at the type level. Attempting to construct it by calling Default::default will panic.

Implementations§

source§

impl Ipv4

source

pub const LIMITED_BROADCAST_ADDRESS: SpecifiedAddr<Ipv4Addr> = _

The limited broadcast address.

The limited broadcast address is considered to be a broadcast address on all networks regardless of subnet address. This is distinct from the subnet-specific broadcast address (e.g., 192.168.255.255 on the subnet 192.168.0.0/16). It is defined in the IANA IPv4 Special-Purpose Address Registry.

source

pub const CLASS_A_SUBNET: Subnet<Ipv4Addr> = _

The Class A subnet.

The Class A subnet is defined in RFC 1812 section 2.2.5.1.

source

pub const CLASS_B_SUBNET: Subnet<Ipv4Addr> = _

The Class B subnet.

The Class B subnet is defined in RFC 1812 section 2.2.5.1.

source

pub const CLASS_C_SUBNET: Subnet<Ipv4Addr> = _

The Class C subnet.

The Class C subnet is defined in RFC 1812 section 2.2.5.1.

source

pub const CLASS_D_SUBNET: Subnet<Ipv4Addr> = _

The Class D subnet.

This subnet is also known as the multicast subnet.

The Class D subnet is defined in RFC 1812 section 2.2.5.1.

source

pub const CLASS_E_SUBNET: Subnet<Ipv4Addr> = _

The Class E subnet.

The Class E subnet is meant for experimental purposes, and should not be used on the general internet. RFC 1812 Section 5.3.7 suggests that routers SHOULD discard packets with a source address in the Class E subnet. The Class E subnet is defined in RFC 1112 Section 4.

The subnet of link-local multicast addresses, outlined in RFC 5771 Section 4.

source

pub const ALL_SYSTEMS_MULTICAST_ADDRESS: MulticastAddr<Ipv4Addr> = _

The multicast address subscribed to by all systems on the local network, defined in the IPv4 Multicast Address Space Registry.

source

pub const ALL_ROUTERS_MULTICAST_ADDRESS: MulticastAddr<Ipv4Addr> = _

The multicast address subscribed to by all routers on the local network, defined in the IPv4 Multicast Address Space Registry.

Trait Implementations§

source§

impl Clone for Ipv4

source§

fn clone(&self) -> Ipv4

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ipv4

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Ipv4

source§

fn default() -> Ipv4

Returns the “default value” for a type. Read more
source§

impl Hash for Ipv4

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ip for Ipv4

source§

const LOOPBACK_ADDRESS: SpecifiedAddr<Ipv4Addr> = _

The default IPv4 address used for loopback, defined in RFC 5735 Section 3.

Note that while this address is the most commonly used address for loopback traffic, any address in the LOOPBACK_SUBNET may be used.

source§

const LOOPBACK_SUBNET: Subnet<Ipv4Addr> = _

The IPv4 loopback subnet, defined in RFC 1122 Section 3.2.1.3.

source§

const MULTICAST_SUBNET: Subnet<Ipv4Addr> = Self::CLASS_D_SUBNET

The IPv4 Multicast subnet, defined in RFC 1112 Section 4.

The subnet of link-local unicast IPv4 addresses, outlined in RFC 3927 Section 2.1.

The IPv4 minimum link MTU.

Per RFC 791 Section 3.2, “[\e]very internet module must be able to forward a datagram of 68 octets without further fragmentation.”

source§

const VERSION: IpVersion = IpVersion::V4

The IP version. Read more
source§

const VERSION_MARKER: IpVersionMarker<Self> = _

The zero-sized-type IP version marker.
source§

const UNSPECIFIED_ADDRESS: Ipv4Addr = _

The unspecified address. Read more
source§

const NAME: &'static str = "IPv4"

“IPv4” or “IPv6”.
§

type Addr = Ipv4Addr

The address type for this IP version. Read more
source§

fn map_ip<In: GenericOverIp<Self, Type = In> + GenericOverIp<Ipv4> + GenericOverIp<Ipv6>, Out: GenericOverIp<Self, Type = Out> + GenericOverIp<Ipv4> + GenericOverIp<Ipv6>>( input: In, v4: impl FnOnce(<In as GenericOverIp<Ipv4>>::Type) -> <Out as GenericOverIp<Ipv4>>::Type, _v6: impl FnOnce(<In as GenericOverIp<Ipv6>>::Type) -> <Out as GenericOverIp<Ipv6>>::Type ) -> Out

Apply one of the given functions to the input and return the result. Read more
source§

impl Ord for Ipv4

source§

fn cmp(&self, other: &Ipv4) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Ipv4

source§

fn eq(&self, other: &Ipv4) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Ipv4

source§

fn partial_cmp(&self, other: &Ipv4) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Ipv4

source§

impl Eq for Ipv4

source§

impl StructuralPartialEq for Ipv4

Auto Trait Implementations§

§

impl Freeze for Ipv4

§

impl RefUnwindSafe for Ipv4

§

impl Send for Ipv4

§

impl Sync for Ipv4

§

impl Unpin for Ipv4

§

impl UnwindSafe for Ipv4

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.