pub struct LeaseStore { /* private fields */ }Implementations§
Source§impl LeaseStore
impl LeaseStore
pub async fn new(file_path: PathBuf) -> Result<Self, LeaseError>
pub async fn insert_lease(&self, lease: Lease) -> Result<(), LeaseError>
pub async fn get_lease_by_ip(&self, ip: &Ipv4Addr) -> Result<Lease, LeaseError>
pub async fn get_ip_from_client_id( &self, client_id: &Vec<u8>, ) -> Result<Ipv4Addr, LeaseError>
pub async fn get_all_leases(&self) -> Result<Vec<Lease>, LeaseError>
pub async fn get_valid_leases(&self) -> Result<Vec<Lease>, LeaseError>
pub async fn is_ip_assigned(&self, ip: Ipv4Addr) -> Result<bool, LeaseError>
pub async fn update_lease_expiry( &self, ip: Ipv4Addr, expires_at: i64, ) -> Result<(), LeaseError>
pub async fn mark_ip_declined(&self, ip: Ipv4Addr) -> Result<(), LeaseError>
pub async fn release_lease( &self, ip: Ipv4Addr, client_id: &Vec<u8>, ) -> Result<(), LeaseError>
Trait Implementations§
Source§impl Clone for LeaseStore
impl Clone for LeaseStore
Source§fn clone(&self) -> LeaseStore
fn clone(&self) -> LeaseStore
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 moreAuto Trait Implementations§
impl Freeze for LeaseStore
impl !RefUnwindSafe for LeaseStore
impl Send for LeaseStore
impl Sync for LeaseStore
impl Unpin for LeaseStore
impl !UnwindSafe for LeaseStore
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