Crate clash_rules

Source

Re-exports§

pub use serde_yaml_ng;

Structs§

AhoCorasick
An automaton for searching multiple strings in linear time.
ClashRuleMatcher
convenient struct for checking all rules.
DomainKeywordMatcher
DomainSuffixMatcher
Ip6Matcher
IpMatcher
IpTrie2
Trie struct for Ipv4Net using radix_trie::Trie, which is a bit slower than prefix_trie::PrifixMap
PrefixMap
Prefix map implemented as a prefix tree.
RuleConfig
RuleSet
Trie
Data-structure for storing and querying string-like keys and associated values.

Enums§

LoadYamlFileError

Constants§

DOMAIN
DOMAIN_KEYWORD
DOMAIN_SUFFIX
GEOIP
IP_CIDR
IP_CIDR6
MATCH
PROCESS_NAME

Traits§

TrieCommon
Common functionality available for tries and subtries.

Functions§

check_ip6_trie
check_ip_trie
check_ip_trie2
check_keyword_ac
check_keyword_ac2
faster than ac, but requries an extra targets lookup vec by get_keywords_targets
check_keyword_dummy
check_prefix_trie
unlike check_suffix_trie, this function matches prefix
check_suffix_dummy
check_suffix_trie
the function matches suffix by reversing the domain
gen_ip6_trie
the function store ips in the trie with their target index of the map
gen_ip_trie
gen_ip_trie2
gen_keywords_ac
gen_keywords_ac2
gen_prefix_trie
the function store domains in the trie with their target index of the map
gen_suffix_trie
the function store domain chars in the result trie in reversed order, and with their target index of the map
get_domain_rules
get_ip6_cidr_rules
get_ip_cidr_rules
get_item_target_map
for DOMAIN, PROCESS-NAME etc. that matches directly
get_keyword_rules
get_keywords_targets
get_suffix_rules
get_target_item_map
for SUFFIX, KEYWORD,CIDR etc. that require iter.
load_rule_set_from_file
load_rules_from_file
merge_method_rules_map
parse_rule_set_as_classic
parse_rule_set_as_domain_suffix_trie
init like let mut trie = Trie::new();
parse_rule_set_as_ip_cidr_trie
init like let mut trie = PrefixMap::<Ipv4Net, usize>::new();
parse_rules
parse clash rules into METHOD-rules hashmap, the ‘,’ splitted items is pushed in the inner Vec