pub struct LeaseConfig {
pub leases_file_path: PathBuf,
pub lease_time: LeaseTime,
pub network_cidr: Ipv4Network,
pub static_leases: HashMap<MacAddress, Ipv4Addr>,
pub use_leases_file: bool,
}Expand description
All configuration for a Leases.
Fields§
§leases_file_path: PathBufThe path where the leases files is written to and read from. The name, however, is always the same and not configurable.
This will only be used when the leases file is used.
lease_time: LeaseTimeSee: LeaseTime
network_cidr: Ipv4NetworkA range of IP addresses for the server to lease. Specified in CIDR notation. For example: 10.1.9.32/16
static_leases: HashMap<MacAddress, Ipv4Addr>The server will always assign these ip adddresses to these mac addresses. All static leases must be within the network_cidr range.
use_leases_file: boolWhether to read and write leases to a file to maintain state between server restarts.
Defaults to true (when not in a benchmark or integration test) but you might want to set to false for performance, lack of storage, etc.
Trait Implementations§
Source§impl Clone for LeaseConfig
impl Clone for LeaseConfig
Source§fn clone(&self) -> LeaseConfig
fn clone(&self) -> LeaseConfig
Returns a duplicate 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 LeaseConfig
impl Debug for LeaseConfig
Source§impl Default for LeaseConfig
impl Default for LeaseConfig
Source§impl<'de> Deserialize<'de> for LeaseConfig
impl<'de> Deserialize<'de> for LeaseConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LeaseConfig
impl RefUnwindSafe for LeaseConfig
impl Send for LeaseConfig
impl Sync for LeaseConfig
impl Unpin for LeaseConfig
impl UnsafeUnpin for LeaseConfig
impl UnwindSafe for LeaseConfig
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