pub struct IpamConfig {
pub subnet: u32,
pub prefix_len: u8,
pub gateway: u32,
pub range_start: u32,
pub range_end: u32,
}Expand description
IPAM configuration for a subnet.
Fields§
§subnet: u32Subnet base address (host byte order).
prefix_len: u8Prefix length (e.g., 24 for /24).
gateway: u32Gateway address.
range_start: u32Start of allocatable range (host part only).
range_end: u32End of allocatable range (host part only, inclusive).
Implementations§
Source§impl IpamConfig
impl IpamConfig
Sourcepub fn new(subnet: u32, prefix_len: u8, gateway_host: u32) -> Self
pub fn new(subnet: u32, prefix_len: u8, gateway_host: u32) -> Self
Create a new IPAM config.
subnet is the network address (e.g., 10.244.0.0 = 0x0AF40000).
prefix_len is the CIDR prefix (e.g., 24).
gateway is the gateway host part (e.g., 1 for .1).
Sourcepub fn total_addresses(&self) -> u32
pub fn total_addresses(&self) -> u32
Get the total number of allocatable addresses.
Trait Implementations§
Source§impl Clone for IpamConfig
impl Clone for IpamConfig
Source§fn clone(&self) -> IpamConfig
fn clone(&self) -> IpamConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IpamConfig
impl RefUnwindSafe for IpamConfig
impl Send for IpamConfig
impl Sync for IpamConfig
impl Unpin for IpamConfig
impl UnwindSafe for IpamConfig
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)