Add must_use attribute to UserConnectionReservation and RouteConnectionLease structs for better resource management

This commit is contained in:
David Osipov
2026-03-17 19:55:55 +04:00
parent 50a827e7fd
commit 4e3f42dce3
3 changed files with 219 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ enum HandshakeOutcome {
Handled,
}
#[must_use = "UserConnectionReservation must be kept alive to retain user/IP reservation until release or drop"]
struct UserConnectionReservation {
stats: Arc<Stats>,
ip_tracker: Arc<UserIpTracker>,