package rule import "github.com/sagernet/sing-box/adapter" type ruleMatchState uint8 const ( ruleMatchSourceAddress ruleMatchState = 1 << iota ruleMatchSourcePort ruleMatchDestinationAddress ruleMatchDestinationPort ) type ruleMatchStateSet uint16 func singleRuleMatchState(state ruleMatchState) ruleMatchStateSet { return 1 << state } func emptyRuleMatchState() ruleMatchStateSet { return singleRuleMatchState(0) } func (s ruleMatchStateSet) isEmpty() bool { return s == 0 } func (s ruleMatchStateSet) contains(state ruleMatchState) bool { return s&(1<