punchnet-macos/Tun/Punchnet/Policy/PolicyRuleSnapshot.swift
2026-05-21 12:22:02 +08:00

27 lines
612 B
Swift

//
// PolicyRuleSnapshot.swift
// punchnet
//
// Created by on 2026/2/5.
//
import Foundation
final class PolicyRuleSnapshot: Snapshot {
typealias IdentityID = UInt32
private let ruleMapByIdentity: [IdentityID: IdentityRuleMap]
init(ruleMapByIdentity: [IdentityID : IdentityRuleMap]) {
self.ruleMapByIdentity = ruleMapByIdentity
}
func lookup(_ id: IdentityID) -> IdentityRuleMap? {
return self.ruleMapByIdentity[id]
}
static func empty() -> PolicyRuleSnapshot {
return PolicyRuleSnapshot(ruleMapByIdentity: [:])
}
}