Struct cni_plugin::ip_range::IpRange [−][src]
A range of IPs, usable for defining an IP pool.
The subnet is the only required field. The range can be further limited
with the range_start and range_end fields, which are inclusive.
Examples
{"subnet": "10.0.0.0/8"}
{"subnet": "10.0.10.0/23", "rangeStart": "10.0.11.0", "rangeEnd": "10.0.11.254"}
{"subnet": "192.168.1.1/24", "gateway": "192.168.1.254"}
Fields
subnet: IpNetworkThe subnet for the range.
range_start: Option<IpAddr>The start of the available range within the subnet, inclusive.
range_end: Option<IpAddr>The end of the available range within the subnet, inclusive.
gateway: Option<IpAddr>The gateway of the range.
Interpretation of an absent gateway is left to the implementation.
Implementations
impl IpRange[src]
pub fn iter_free(&self) -> impl Iterator<Item = (IpNetwork, &Self)>[src]
Naive implementation of iterating the IP range.
This iterator will yield every IP available in the range, that is, every
IP in the subnet, except those lower than range_start, higher than
range_end, or the one which is the gateway.
The current implementation iterates through the entire range and filters
off the excluded IPs as per above. For IPv4 this will likely never be an
issue but IPv6 ranges are monstrous and could spend a long time spinning
before reaching range_start.
Trait Implementations
impl Clone for IpRange[src]
impl Debug for IpRange[src]
impl<'de> Deserialize<'de> for IpRange[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Serialize for IpRange[src]
Auto Trait Implementations
impl RefUnwindSafe for IpRange
impl Send for IpRange
impl Sync for IpRange
impl Unpin for IpRange
impl UnwindSafe for IpRange
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,