diff options
| -rw-r--r-- | Cargo.lock | 622 | ||||
| -rw-r--r-- | Cargo.toml | 11 | ||||
| -rw-r--r-- | pyproject.toml | 4 | ||||
| -rw-r--r-- | src/lib.rs | 251 |
4 files changed, 502 insertions, 386 deletions
| @@ -1,275 +1,372 @@ | |||
| 1 | # This file is automatically @generated by Cargo. | 1 | # This file is automatically @generated by Cargo. |
| 2 | # It is not intended for manual editing. | 2 | # It is not intended for manual editing. |
| 3 | version = 3 | 3 | version = 4 |
| 4 | 4 | ||
| 5 | [[package]] | 5 | [[package]] |
| 6 | name = "adblock" | 6 | name = "adblock" |
| 7 | version = "0.5.6" | 7 | version = "0.7.0" |
| 8 | dependencies = [ | ||
| 9 | "adblock 0.11.1", | ||
| 10 | "pyo3", | ||
| 11 | ] | ||
| 12 | |||
| 13 | [[package]] | ||
| 14 | name = "adblock" | ||
| 15 | version = "0.11.1" | ||
| 8 | source = "registry+https://github.com/rust-lang/crates.io-index" | 16 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 9 | checksum = "27785ef5b89bc88fd2def3e1ecfefdf5ec1583795b916667afd15b13058f8315" | 17 | checksum = "5d6a431e8b3c95fa49574ed925b85fe34978f5917168c8ce4dcf729af861fc87" |
| 10 | dependencies = [ | 18 | dependencies = [ |
| 11 | "addr", | 19 | "addr", |
| 12 | "base64", | 20 | "base64", |
| 13 | "bitflags", | 21 | "bitflags", |
| 14 | "flate2", | 22 | "flatbuffers", |
| 15 | "idna", | 23 | "idna", |
| 16 | "itertools", | 24 | "itertools", |
| 25 | "memchr", | ||
| 17 | "once_cell", | 26 | "once_cell", |
| 18 | "percent-encoding", | 27 | "percent-encoding", |
| 28 | "precomputed-hash", | ||
| 19 | "regex", | 29 | "regex", |
| 20 | "rmp-serde 0.13.7", | 30 | "rmp-serde", |
| 21 | "rmp-serde 0.15.5", | 31 | "rustc-hash", |
| 22 | "seahash", | 32 | "seahash", |
| 23 | "serde", | 33 | "serde", |
| 24 | "twoway", | 34 | "serde_json", |
| 35 | "thiserror", | ||
| 25 | "url", | 36 | "url", |
| 26 | ] | 37 | ] |
| 27 | 38 | ||
| 28 | [[package]] | 39 | [[package]] |
| 29 | name = "adblock" | ||
| 30 | version = "0.6.0" | ||
| 31 | dependencies = [ | ||
| 32 | "adblock 0.5.6", | ||
| 33 | "pyo3", | ||
| 34 | ] | ||
| 35 | |||
| 36 | [[package]] | ||
| 37 | name = "addr" | 40 | name = "addr" |
| 38 | version = "0.14.0" | 41 | version = "0.15.6" |
| 39 | source = "registry+https://github.com/rust-lang/crates.io-index" | 42 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 40 | checksum = "c54ccac949a2afafdfc889e15c753bbc6ee8783e026bbe3d057b00b13907db70" | 43 | checksum = "a93b8a41dbe230ad5087cc721f8d41611de654542180586b315d9f4cf6b72bef" |
| 41 | dependencies = [ | 44 | dependencies = [ |
| 42 | "psl", | 45 | "psl", |
| 43 | "psl-types", | 46 | "psl-types", |
| 44 | ] | 47 | ] |
| 45 | 48 | ||
| 46 | [[package]] | 49 | [[package]] |
| 47 | name = "adler" | ||
| 48 | version = "1.0.2" | ||
| 49 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 50 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" | ||
| 51 | |||
| 52 | [[package]] | ||
| 53 | name = "aho-corasick" | 50 | name = "aho-corasick" |
| 54 | version = "0.7.18" | 51 | version = "1.1.4" |
| 55 | source = "registry+https://github.com/rust-lang/crates.io-index" | 52 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 56 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" | 53 | checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" |
| 57 | dependencies = [ | 54 | dependencies = [ |
| 58 | "memchr", | 55 | "memchr", |
| 59 | ] | 56 | ] |
| 60 | 57 | ||
| 61 | [[package]] | 58 | [[package]] |
| 62 | name = "autocfg" | 59 | name = "autocfg" |
| 63 | version = "1.1.0" | 60 | version = "1.5.0" |
| 64 | source = "registry+https://github.com/rust-lang/crates.io-index" | 61 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 65 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" | 62 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" |
| 66 | 63 | ||
| 67 | [[package]] | 64 | [[package]] |
| 68 | name = "base64" | 65 | name = "base64" |
| 69 | version = "0.13.0" | 66 | version = "0.22.1" |
| 70 | source = "registry+https://github.com/rust-lang/crates.io-index" | 67 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 71 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" | 68 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" |
| 72 | 69 | ||
| 73 | [[package]] | 70 | [[package]] |
| 74 | name = "bitflags" | 71 | name = "bitflags" |
| 75 | version = "1.3.2" | 72 | version = "2.10.0" |
| 76 | source = "registry+https://github.com/rust-lang/crates.io-index" | 73 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 77 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" | 74 | checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" |
| 75 | dependencies = [ | ||
| 76 | "serde_core", | ||
| 77 | ] | ||
| 78 | 78 | ||
| 79 | [[package]] | 79 | [[package]] |
| 80 | name = "byteorder" | 80 | name = "byteorder" |
| 81 | version = "1.4.3" | 81 | version = "1.5.0" |
| 82 | source = "registry+https://github.com/rust-lang/crates.io-index" | 82 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 83 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" | 83 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" |
| 84 | 84 | ||
| 85 | [[package]] | 85 | [[package]] |
| 86 | name = "cfg-if" | 86 | name = "cfg-if" |
| 87 | version = "1.0.0" | 87 | version = "1.0.4" |
| 88 | source = "registry+https://github.com/rust-lang/crates.io-index" | 88 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 89 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" | 89 | checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" |
| 90 | 90 | ||
| 91 | [[package]] | 91 | [[package]] |
| 92 | name = "crc32fast" | 92 | name = "displaydoc" |
| 93 | version = "1.3.2" | 93 | version = "0.2.5" |
| 94 | source = "registry+https://github.com/rust-lang/crates.io-index" | 94 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 95 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" | 95 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" |
| 96 | dependencies = [ | 96 | dependencies = [ |
| 97 | "cfg-if", | 97 | "proc-macro2", |
| 98 | "quote", | ||
| 99 | "syn", | ||
| 98 | ] | 100 | ] |
| 99 | 101 | ||
| 100 | [[package]] | 102 | [[package]] |
| 101 | name = "either" | 103 | name = "either" |
| 102 | version = "1.7.0" | 104 | version = "1.15.0" |
| 103 | source = "registry+https://github.com/rust-lang/crates.io-index" | 105 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 104 | checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" | 106 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" |
| 105 | 107 | ||
| 106 | [[package]] | 108 | [[package]] |
| 107 | name = "flate2" | 109 | name = "flatbuffers" |
| 108 | version = "1.0.24" | 110 | version = "25.9.23" |
| 109 | source = "registry+https://github.com/rust-lang/crates.io-index" | 111 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 110 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" | 112 | checksum = "09b6620799e7340ebd9968d2e0708eb82cf1971e9a16821e2091b6d6e475eed5" |
| 111 | dependencies = [ | 113 | dependencies = [ |
| 112 | "crc32fast", | 114 | "bitflags", |
| 113 | "miniz_oxide", | 115 | "rustc_version", |
| 114 | ] | 116 | ] |
| 115 | 117 | ||
| 116 | [[package]] | 118 | [[package]] |
| 117 | name = "form_urlencoded" | 119 | name = "form_urlencoded" |
| 118 | version = "1.0.1" | 120 | version = "1.2.2" |
| 119 | source = "registry+https://github.com/rust-lang/crates.io-index" | 121 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 120 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" | 122 | checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" |
| 121 | dependencies = [ | 123 | dependencies = [ |
| 122 | "matches", | ||
| 123 | "percent-encoding", | 124 | "percent-encoding", |
| 124 | ] | 125 | ] |
| 125 | 126 | ||
| 126 | [[package]] | 127 | [[package]] |
| 127 | name = "idna" | 128 | name = "heck" |
| 128 | version = "0.2.3" | 129 | version = "0.5.0" |
| 130 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 131 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" | ||
| 132 | |||
| 133 | [[package]] | ||
| 134 | name = "icu_collections" | ||
| 135 | version = "2.1.1" | ||
| 129 | source = "registry+https://github.com/rust-lang/crates.io-index" | 136 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 130 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" | 137 | checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" |
| 131 | dependencies = [ | 138 | dependencies = [ |
| 132 | "matches", | 139 | "displaydoc", |
| 133 | "unicode-bidi", | 140 | "potential_utf", |
| 134 | "unicode-normalization", | 141 | "yoke", |
| 142 | "zerofrom", | ||
| 143 | "zerovec", | ||
| 135 | ] | 144 | ] |
| 136 | 145 | ||
| 137 | [[package]] | 146 | [[package]] |
| 138 | name = "indoc" | 147 | name = "icu_locale_core" |
| 139 | version = "1.0.6" | 148 | version = "2.1.1" |
| 140 | source = "registry+https://github.com/rust-lang/crates.io-index" | 149 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 141 | checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e" | 150 | checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" |
| 151 | dependencies = [ | ||
| 152 | "displaydoc", | ||
| 153 | "litemap", | ||
| 154 | "tinystr", | ||
| 155 | "writeable", | ||
| 156 | "zerovec", | ||
| 157 | ] | ||
| 142 | 158 | ||
| 143 | [[package]] | 159 | [[package]] |
| 144 | name = "itertools" | 160 | name = "icu_normalizer" |
| 145 | version = "0.10.3" | 161 | version = "2.1.1" |
| 146 | source = "registry+https://github.com/rust-lang/crates.io-index" | 162 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 147 | checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" | 163 | checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" |
| 148 | dependencies = [ | 164 | dependencies = [ |
| 149 | "either", | 165 | "icu_collections", |
| 166 | "icu_normalizer_data", | ||
| 167 | "icu_properties", | ||
| 168 | "icu_provider", | ||
| 169 | "smallvec", | ||
| 170 | "zerovec", | ||
| 150 | ] | 171 | ] |
| 151 | 172 | ||
| 152 | [[package]] | 173 | [[package]] |
| 153 | name = "libc" | 174 | name = "icu_normalizer_data" |
| 154 | version = "0.2.126" | 175 | version = "2.1.1" |
| 155 | source = "registry+https://github.com/rust-lang/crates.io-index" | 176 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 156 | checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" | 177 | checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" |
| 157 | 178 | ||
| 158 | [[package]] | 179 | [[package]] |
| 159 | name = "lock_api" | 180 | name = "icu_properties" |
| 160 | version = "0.4.7" | 181 | version = "2.1.1" |
| 161 | source = "registry+https://github.com/rust-lang/crates.io-index" | 182 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 162 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" | 183 | checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" |
| 163 | dependencies = [ | 184 | dependencies = [ |
| 164 | "autocfg", | 185 | "icu_collections", |
| 165 | "scopeguard", | 186 | "icu_locale_core", |
| 187 | "icu_properties_data", | ||
| 188 | "icu_provider", | ||
| 189 | "zerotrie", | ||
| 190 | "zerovec", | ||
| 166 | ] | 191 | ] |
| 167 | 192 | ||
| 168 | [[package]] | 193 | [[package]] |
| 169 | name = "matches" | 194 | name = "icu_properties_data" |
| 170 | version = "0.1.9" | 195 | version = "2.1.1" |
| 171 | source = "registry+https://github.com/rust-lang/crates.io-index" | 196 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 172 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" | 197 | checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" |
| 173 | 198 | ||
| 174 | [[package]] | 199 | [[package]] |
| 175 | name = "memchr" | 200 | name = "icu_provider" |
| 176 | version = "2.5.0" | 201 | version = "2.1.1" |
| 177 | source = "registry+https://github.com/rust-lang/crates.io-index" | 202 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 178 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" | 203 | checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" |
| 204 | dependencies = [ | ||
| 205 | "displaydoc", | ||
| 206 | "icu_locale_core", | ||
| 207 | "writeable", | ||
| 208 | "yoke", | ||
| 209 | "zerofrom", | ||
| 210 | "zerotrie", | ||
| 211 | "zerovec", | ||
| 212 | ] | ||
| 179 | 213 | ||
| 180 | [[package]] | 214 | [[package]] |
| 181 | name = "miniz_oxide" | 215 | name = "idna" |
| 182 | version = "0.5.3" | 216 | version = "1.1.0" |
| 183 | source = "registry+https://github.com/rust-lang/crates.io-index" | 217 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 184 | checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" | 218 | checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" |
| 185 | dependencies = [ | 219 | dependencies = [ |
| 186 | "adler", | 220 | "idna_adapter", |
| 221 | "smallvec", | ||
| 222 | "utf8_iter", | ||
| 187 | ] | 223 | ] |
| 188 | 224 | ||
| 189 | [[package]] | 225 | [[package]] |
| 190 | name = "num-traits" | 226 | name = "idna_adapter" |
| 191 | version = "0.2.15" | 227 | version = "1.2.1" |
| 192 | source = "registry+https://github.com/rust-lang/crates.io-index" | 228 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 193 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" | 229 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" |
| 194 | dependencies = [ | 230 | dependencies = [ |
| 195 | "autocfg", | 231 | "icu_normalizer", |
| 232 | "icu_properties", | ||
| 196 | ] | 233 | ] |
| 197 | 234 | ||
| 198 | [[package]] | 235 | [[package]] |
| 199 | name = "once_cell" | 236 | name = "indoc" |
| 200 | version = "1.13.0" | 237 | version = "2.0.7" |
| 201 | source = "registry+https://github.com/rust-lang/crates.io-index" | 238 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 202 | checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" | 239 | checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" |
| 240 | dependencies = [ | ||
| 241 | "rustversion", | ||
| 242 | ] | ||
| 203 | 243 | ||
| 204 | [[package]] | 244 | [[package]] |
| 205 | name = "parking_lot" | 245 | name = "itertools" |
| 206 | version = "0.12.1" | 246 | version = "0.13.0" |
| 207 | source = "registry+https://github.com/rust-lang/crates.io-index" | 247 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 208 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" | 248 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" |
| 209 | dependencies = [ | 249 | dependencies = [ |
| 210 | "lock_api", | 250 | "either", |
| 211 | "parking_lot_core", | ||
| 212 | ] | 251 | ] |
| 213 | 252 | ||
| 214 | [[package]] | 253 | [[package]] |
| 215 | name = "parking_lot_core" | 254 | name = "itoa" |
| 216 | version = "0.9.3" | 255 | version = "1.0.15" |
| 256 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 257 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" | ||
| 258 | |||
| 259 | [[package]] | ||
| 260 | name = "libc" | ||
| 261 | version = "0.2.177" | ||
| 262 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 263 | checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" | ||
| 264 | |||
| 265 | [[package]] | ||
| 266 | name = "litemap" | ||
| 267 | version = "0.8.1" | ||
| 217 | source = "registry+https://github.com/rust-lang/crates.io-index" | 268 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 218 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" | 269 | checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" |
| 270 | |||
| 271 | [[package]] | ||
| 272 | name = "memchr" | ||
| 273 | version = "2.7.6" | ||
| 274 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 275 | checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" | ||
| 276 | |||
| 277 | [[package]] | ||
| 278 | name = "memoffset" | ||
| 279 | version = "0.9.1" | ||
| 280 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 281 | checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" | ||
| 219 | dependencies = [ | 282 | dependencies = [ |
| 220 | "cfg-if", | 283 | "autocfg", |
| 221 | "libc", | ||
| 222 | "redox_syscall", | ||
| 223 | "smallvec", | ||
| 224 | "windows-sys", | ||
| 225 | ] | 284 | ] |
| 226 | 285 | ||
| 227 | [[package]] | 286 | [[package]] |
| 287 | name = "num-traits" | ||
| 288 | version = "0.2.19" | ||
| 289 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 290 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" | ||
| 291 | dependencies = [ | ||
| 292 | "autocfg", | ||
| 293 | ] | ||
| 294 | |||
| 295 | [[package]] | ||
| 296 | name = "once_cell" | ||
| 297 | version = "1.21.3" | ||
| 298 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 299 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" | ||
| 300 | |||
| 301 | [[package]] | ||
| 228 | name = "paste" | 302 | name = "paste" |
| 229 | version = "1.0.7" | 303 | version = "1.0.15" |
| 230 | source = "registry+https://github.com/rust-lang/crates.io-index" | 304 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 231 | checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" | 305 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" |
| 232 | 306 | ||
| 233 | [[package]] | 307 | [[package]] |
| 234 | name = "percent-encoding" | 308 | name = "percent-encoding" |
| 235 | version = "2.1.0" | 309 | version = "2.3.2" |
| 236 | source = "registry+https://github.com/rust-lang/crates.io-index" | 310 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 237 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" | 311 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" |
| 312 | |||
| 313 | [[package]] | ||
| 314 | name = "portable-atomic" | ||
| 315 | version = "1.11.1" | ||
| 316 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 317 | checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" | ||
| 318 | |||
| 319 | [[package]] | ||
| 320 | name = "potential_utf" | ||
| 321 | version = "0.1.4" | ||
| 322 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 323 | checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" | ||
| 324 | dependencies = [ | ||
| 325 | "zerovec", | ||
| 326 | ] | ||
| 327 | |||
| 328 | [[package]] | ||
| 329 | name = "precomputed-hash" | ||
| 330 | version = "0.1.1" | ||
| 331 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 332 | checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" | ||
| 238 | 333 | ||
| 239 | [[package]] | 334 | [[package]] |
| 240 | name = "proc-macro2" | 335 | name = "proc-macro2" |
| 241 | version = "1.0.40" | 336 | version = "1.0.103" |
| 242 | source = "registry+https://github.com/rust-lang/crates.io-index" | 337 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 243 | checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" | 338 | checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" |
| 244 | dependencies = [ | 339 | dependencies = [ |
| 245 | "unicode-ident", | 340 | "unicode-ident", |
| 246 | ] | 341 | ] |
| 247 | 342 | ||
| 248 | [[package]] | 343 | [[package]] |
| 249 | name = "psl" | 344 | name = "psl" |
| 250 | version = "2.0.90" | 345 | version = "2.1.161" |
| 251 | source = "registry+https://github.com/rust-lang/crates.io-index" | 346 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 252 | checksum = "7e9c7d362659b525758d09e2a3ae965e371b347605e5fb2bc5bec5c2a1ecf41b" | 347 | checksum = "96f36d5dda1aa6585ce2a74b0ae1a85e530db47b0186cd06b63f09dbd8035fc6" |
| 253 | dependencies = [ | 348 | dependencies = [ |
| 254 | "psl-types", | 349 | "psl-types", |
| 255 | ] | 350 | ] |
| 256 | 351 | ||
| 257 | [[package]] | 352 | [[package]] |
| 258 | name = "psl-types" | 353 | name = "psl-types" |
| 259 | version = "2.0.10" | 354 | version = "2.0.11" |
| 260 | source = "registry+https://github.com/rust-lang/crates.io-index" | 355 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 261 | checksum = "e8eda7c62d9ecaafdf8b62374c006de0adf61666ae96a96ba74a37134aa4e470" | 356 | checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" |
| 262 | 357 | ||
| 263 | [[package]] | 358 | [[package]] |
| 264 | name = "pyo3" | 359 | name = "pyo3" |
| 265 | version = "0.16.5" | 360 | version = "0.22.6" |
| 266 | source = "registry+https://github.com/rust-lang/crates.io-index" | 361 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 267 | checksum = "1e6302e85060011447471887705bb7838f14aba43fcb06957d823739a496b3dc" | 362 | checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884" |
| 268 | dependencies = [ | 363 | dependencies = [ |
| 269 | "cfg-if", | 364 | "cfg-if", |
| 270 | "indoc", | 365 | "indoc", |
| 271 | "libc", | 366 | "libc", |
| 272 | "parking_lot", | 367 | "memoffset", |
| 368 | "once_cell", | ||
| 369 | "portable-atomic", | ||
| 273 | "pyo3-build-config", | 370 | "pyo3-build-config", |
| 274 | "pyo3-ffi", | 371 | "pyo3-ffi", |
| 275 | "pyo3-macros", | 372 | "pyo3-macros", |
| @@ -278,9 +375,9 @@ dependencies = [ | |||
| 278 | 375 | ||
| 279 | [[package]] | 376 | [[package]] |
| 280 | name = "pyo3-build-config" | 377 | name = "pyo3-build-config" |
| 281 | version = "0.16.5" | 378 | version = "0.22.6" |
| 282 | source = "registry+https://github.com/rust-lang/crates.io-index" | 379 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 283 | checksum = "b5b65b546c35d8a3b1b2f0ddbac7c6a569d759f357f2b9df884f5d6b719152c8" | 380 | checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38" |
| 284 | dependencies = [ | 381 | dependencies = [ |
| 285 | "once_cell", | 382 | "once_cell", |
| 286 | "target-lexicon", | 383 | "target-lexicon", |
| @@ -288,9 +385,9 @@ dependencies = [ | |||
| 288 | 385 | ||
| 289 | [[package]] | 386 | [[package]] |
| 290 | name = "pyo3-ffi" | 387 | name = "pyo3-ffi" |
| 291 | version = "0.16.5" | 388 | version = "0.22.6" |
| 292 | source = "registry+https://github.com/rust-lang/crates.io-index" | 389 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 293 | checksum = "c275a07127c1aca33031a563e384ffdd485aee34ef131116fcd58e3430d1742b" | 390 | checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636" |
| 294 | dependencies = [ | 391 | dependencies = [ |
| 295 | "libc", | 392 | "libc", |
| 296 | "pyo3-build-config", | 393 | "pyo3-build-config", |
| @@ -298,9 +395,9 @@ dependencies = [ | |||
| 298 | 395 | ||
| 299 | [[package]] | 396 | [[package]] |
| 300 | name = "pyo3-macros" | 397 | name = "pyo3-macros" |
| 301 | version = "0.16.5" | 398 | version = "0.22.6" |
| 302 | source = "registry+https://github.com/rust-lang/crates.io-index" | 399 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 303 | checksum = "284fc4485bfbcc9850a6d661d627783f18d19c2ab55880b021671c4ba83e90f7" | 400 | checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453" |
| 304 | dependencies = [ | 401 | dependencies = [ |
| 305 | "proc-macro2", | 402 | "proc-macro2", |
| 306 | "pyo3-macros-backend", | 403 | "pyo3-macros-backend", |
| @@ -310,38 +407,43 @@ dependencies = [ | |||
| 310 | 407 | ||
| 311 | [[package]] | 408 | [[package]] |
| 312 | name = "pyo3-macros-backend" | 409 | name = "pyo3-macros-backend" |
| 313 | version = "0.16.5" | 410 | version = "0.22.6" |
| 314 | source = "registry+https://github.com/rust-lang/crates.io-index" | 411 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 315 | checksum = "53bda0f58f73f5c5429693c96ed57f7abdb38fdfc28ae06da4101a257adb7faf" | 412 | checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe" |
| 316 | dependencies = [ | 413 | dependencies = [ |
| 414 | "heck", | ||
| 317 | "proc-macro2", | 415 | "proc-macro2", |
| 416 | "pyo3-build-config", | ||
| 318 | "quote", | 417 | "quote", |
| 319 | "syn", | 418 | "syn", |
| 320 | ] | 419 | ] |
| 321 | 420 | ||
| 322 | [[package]] | 421 | [[package]] |
| 323 | name = "quote" | 422 | name = "quote" |
| 324 | version = "1.0.20" | 423 | version = "1.0.42" |
| 325 | source = "registry+https://github.com/rust-lang/crates.io-index" | 424 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 326 | checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" | 425 | checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" |
| 327 | dependencies = [ | 426 | dependencies = [ |
| 328 | "proc-macro2", | 427 | "proc-macro2", |
| 329 | ] | 428 | ] |
| 330 | 429 | ||
| 331 | [[package]] | 430 | [[package]] |
| 332 | name = "redox_syscall" | 431 | name = "regex" |
| 333 | version = "0.2.13" | 432 | version = "1.12.2" |
| 334 | source = "registry+https://github.com/rust-lang/crates.io-index" | 433 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 335 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" | 434 | checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" |
| 336 | dependencies = [ | 435 | dependencies = [ |
| 337 | "bitflags", | 436 | "aho-corasick", |
| 437 | "memchr", | ||
| 438 | "regex-automata", | ||
| 439 | "regex-syntax", | ||
| 338 | ] | 440 | ] |
| 339 | 441 | ||
| 340 | [[package]] | 442 | [[package]] |
| 341 | name = "regex" | 443 | name = "regex-automata" |
| 342 | version = "1.6.0" | 444 | version = "0.4.13" |
| 343 | source = "registry+https://github.com/rust-lang/crates.io-index" | 445 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 344 | checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" | 446 | checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" |
| 345 | dependencies = [ | 447 | dependencies = [ |
| 346 | "aho-corasick", | 448 | "aho-corasick", |
| 347 | "memchr", | 449 | "memchr", |
| @@ -350,15 +452,15 @@ dependencies = [ | |||
| 350 | 452 | ||
| 351 | [[package]] | 453 | [[package]] |
| 352 | name = "regex-syntax" | 454 | name = "regex-syntax" |
| 353 | version = "0.6.27" | 455 | version = "0.8.8" |
| 354 | source = "registry+https://github.com/rust-lang/crates.io-index" | 456 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 355 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" | 457 | checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" |
| 356 | 458 | ||
| 357 | [[package]] | 459 | [[package]] |
| 358 | name = "rmp" | 460 | name = "rmp" |
| 359 | version = "0.8.11" | 461 | version = "0.8.14" |
| 360 | source = "registry+https://github.com/rust-lang/crates.io-index" | 462 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 361 | checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" | 463 | checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" |
| 362 | dependencies = [ | 464 | dependencies = [ |
| 363 | "byteorder", | 465 | "byteorder", |
| 364 | "num-traits", | 466 | "num-traits", |
| @@ -367,9 +469,9 @@ dependencies = [ | |||
| 367 | 469 | ||
| 368 | [[package]] | 470 | [[package]] |
| 369 | name = "rmp-serde" | 471 | name = "rmp-serde" |
| 370 | version = "0.13.7" | 472 | version = "0.15.5" |
| 371 | source = "registry+https://github.com/rust-lang/crates.io-index" | 473 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 372 | checksum = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" | 474 | checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d" |
| 373 | dependencies = [ | 475 | dependencies = [ |
| 374 | "byteorder", | 476 | "byteorder", |
| 375 | "rmp", | 477 | "rmp", |
| @@ -377,42 +479,68 @@ dependencies = [ | |||
| 377 | ] | 479 | ] |
| 378 | 480 | ||
| 379 | [[package]] | 481 | [[package]] |
| 380 | name = "rmp-serde" | 482 | name = "rustc-hash" |
| 381 | version = "0.15.5" | 483 | version = "1.1.0" |
| 382 | source = "registry+https://github.com/rust-lang/crates.io-index" | 484 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 383 | checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d" | 485 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" |
| 486 | |||
| 487 | [[package]] | ||
| 488 | name = "rustc_version" | ||
| 489 | version = "0.4.1" | ||
| 490 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 491 | checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" | ||
| 384 | dependencies = [ | 492 | dependencies = [ |
| 385 | "byteorder", | 493 | "semver", |
| 386 | "rmp", | ||
| 387 | "serde", | ||
| 388 | ] | 494 | ] |
| 389 | 495 | ||
| 390 | [[package]] | 496 | [[package]] |
| 391 | name = "scopeguard" | 497 | name = "rustversion" |
| 392 | version = "1.1.0" | 498 | version = "1.0.22" |
| 499 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 500 | checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" | ||
| 501 | |||
| 502 | [[package]] | ||
| 503 | name = "ryu" | ||
| 504 | version = "1.0.20" | ||
| 393 | source = "registry+https://github.com/rust-lang/crates.io-index" | 505 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 394 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" | 506 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" |
| 395 | 507 | ||
| 396 | [[package]] | 508 | [[package]] |
| 397 | name = "seahash" | 509 | name = "seahash" |
| 398 | version = "3.0.7" | 510 | version = "4.1.0" |
| 399 | source = "registry+https://github.com/rust-lang/crates.io-index" | 511 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 400 | checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" | 512 | checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" |
| 513 | |||
| 514 | [[package]] | ||
| 515 | name = "semver" | ||
| 516 | version = "1.0.27" | ||
| 517 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 518 | checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" | ||
| 401 | 519 | ||
| 402 | [[package]] | 520 | [[package]] |
| 403 | name = "serde" | 521 | name = "serde" |
| 404 | version = "1.0.139" | 522 | version = "1.0.228" |
| 523 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 524 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| 525 | dependencies = [ | ||
| 526 | "serde_core", | ||
| 527 | "serde_derive", | ||
| 528 | ] | ||
| 529 | |||
| 530 | [[package]] | ||
| 531 | name = "serde_core" | ||
| 532 | version = "1.0.228" | ||
| 405 | source = "registry+https://github.com/rust-lang/crates.io-index" | 533 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 406 | checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" | 534 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" |
| 407 | dependencies = [ | 535 | dependencies = [ |
| 408 | "serde_derive", | 536 | "serde_derive", |
| 409 | ] | 537 | ] |
| 410 | 538 | ||
| 411 | [[package]] | 539 | [[package]] |
| 412 | name = "serde_derive" | 540 | name = "serde_derive" |
| 413 | version = "1.0.139" | 541 | version = "1.0.228" |
| 414 | source = "registry+https://github.com/rust-lang/crates.io-index" | 542 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 415 | checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" | 543 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" |
| 416 | dependencies = [ | 544 | dependencies = [ |
| 417 | "proc-macro2", | 545 | "proc-macro2", |
| 418 | "quote", | 546 | "quote", |
| @@ -420,16 +548,35 @@ dependencies = [ | |||
| 420 | ] | 548 | ] |
| 421 | 549 | ||
| 422 | [[package]] | 550 | [[package]] |
| 551 | name = "serde_json" | ||
| 552 | version = "1.0.145" | ||
| 553 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 554 | checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" | ||
| 555 | dependencies = [ | ||
| 556 | "itoa", | ||
| 557 | "memchr", | ||
| 558 | "ryu", | ||
| 559 | "serde", | ||
| 560 | "serde_core", | ||
| 561 | ] | ||
| 562 | |||
| 563 | [[package]] | ||
| 423 | name = "smallvec" | 564 | name = "smallvec" |
| 424 | version = "1.9.0" | 565 | version = "1.15.1" |
| 425 | source = "registry+https://github.com/rust-lang/crates.io-index" | 566 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 426 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" | 567 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" |
| 568 | |||
| 569 | [[package]] | ||
| 570 | name = "stable_deref_trait" | ||
| 571 | version = "1.2.1" | ||
| 572 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 573 | checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" | ||
| 427 | 574 | ||
| 428 | [[package]] | 575 | [[package]] |
| 429 | name = "syn" | 576 | name = "syn" |
| 430 | version = "1.0.98" | 577 | version = "2.0.110" |
| 431 | source = "registry+https://github.com/rust-lang/crates.io-index" | 578 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 432 | checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" | 579 | checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" |
| 433 | dependencies = [ | 580 | dependencies = [ |
| 434 | "proc-macro2", | 581 | "proc-macro2", |
| 435 | "quote", | 582 | "quote", |
| @@ -437,120 +584,161 @@ dependencies = [ | |||
| 437 | ] | 584 | ] |
| 438 | 585 | ||
| 439 | [[package]] | 586 | [[package]] |
| 587 | name = "synstructure" | ||
| 588 | version = "0.13.2" | ||
| 589 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 590 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" | ||
| 591 | dependencies = [ | ||
| 592 | "proc-macro2", | ||
| 593 | "quote", | ||
| 594 | "syn", | ||
| 595 | ] | ||
| 596 | |||
| 597 | [[package]] | ||
| 440 | name = "target-lexicon" | 598 | name = "target-lexicon" |
| 441 | version = "0.12.4" | 599 | version = "0.12.16" |
| 442 | source = "registry+https://github.com/rust-lang/crates.io-index" | 600 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 443 | checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" | 601 | checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" |
| 444 | 602 | ||
| 445 | [[package]] | 603 | [[package]] |
| 446 | name = "tinyvec" | 604 | name = "thiserror" |
| 447 | version = "1.6.0" | 605 | version = "1.0.69" |
| 448 | source = "registry+https://github.com/rust-lang/crates.io-index" | 606 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 449 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" | 607 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" |
| 450 | dependencies = [ | 608 | dependencies = [ |
| 451 | "tinyvec_macros", | 609 | "thiserror-impl", |
| 452 | ] | 610 | ] |
| 453 | 611 | ||
| 454 | [[package]] | 612 | [[package]] |
| 455 | name = "tinyvec_macros" | 613 | name = "thiserror-impl" |
| 456 | version = "0.1.0" | 614 | version = "1.0.69" |
| 457 | source = "registry+https://github.com/rust-lang/crates.io-index" | 615 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 458 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" | 616 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" |
| 617 | dependencies = [ | ||
| 618 | "proc-macro2", | ||
| 619 | "quote", | ||
| 620 | "syn", | ||
| 621 | ] | ||
| 459 | 622 | ||
| 460 | [[package]] | 623 | [[package]] |
| 461 | name = "twoway" | 624 | name = "tinystr" |
| 462 | version = "0.2.2" | 625 | version = "0.8.2" |
| 463 | source = "registry+https://github.com/rust-lang/crates.io-index" | 626 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 464 | checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" | 627 | checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" |
| 465 | dependencies = [ | 628 | dependencies = [ |
| 466 | "memchr", | 629 | "displaydoc", |
| 467 | "unchecked-index", | 630 | "zerovec", |
| 468 | ] | 631 | ] |
| 469 | 632 | ||
| 470 | [[package]] | 633 | [[package]] |
| 471 | name = "unchecked-index" | 634 | name = "unicode-ident" |
| 472 | version = "0.2.2" | 635 | version = "1.0.22" |
| 473 | source = "registry+https://github.com/rust-lang/crates.io-index" | 636 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 474 | checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" | 637 | checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" |
| 475 | 638 | ||
| 476 | [[package]] | 639 | [[package]] |
| 477 | name = "unicode-bidi" | 640 | name = "unindent" |
| 478 | version = "0.3.8" | 641 | version = "0.2.4" |
| 479 | source = "registry+https://github.com/rust-lang/crates.io-index" | 642 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 480 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" | 643 | checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" |
| 481 | 644 | ||
| 482 | [[package]] | 645 | [[package]] |
| 483 | name = "unicode-ident" | 646 | name = "url" |
| 484 | version = "1.0.2" | 647 | version = "2.5.7" |
| 485 | source = "registry+https://github.com/rust-lang/crates.io-index" | 648 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 486 | checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" | 649 | checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" |
| 650 | dependencies = [ | ||
| 651 | "form_urlencoded", | ||
| 652 | "idna", | ||
| 653 | "percent-encoding", | ||
| 654 | "serde", | ||
| 655 | ] | ||
| 487 | 656 | ||
| 488 | [[package]] | 657 | [[package]] |
| 489 | name = "unicode-normalization" | 658 | name = "utf8_iter" |
| 490 | version = "0.1.21" | 659 | version = "1.0.4" |
| 491 | source = "registry+https://github.com/rust-lang/crates.io-index" | 660 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 492 | checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" | 661 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" |
| 493 | dependencies = [ | ||
| 494 | "tinyvec", | ||
| 495 | ] | ||
| 496 | 662 | ||
| 497 | [[package]] | 663 | [[package]] |
| 498 | name = "unindent" | 664 | name = "writeable" |
| 499 | version = "0.1.9" | 665 | version = "0.6.2" |
| 500 | source = "registry+https://github.com/rust-lang/crates.io-index" | 666 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 501 | checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44" | 667 | checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" |
| 502 | 668 | ||
| 503 | [[package]] | 669 | [[package]] |
| 504 | name = "url" | 670 | name = "yoke" |
| 505 | version = "2.2.2" | 671 | version = "0.8.1" |
| 506 | source = "registry+https://github.com/rust-lang/crates.io-index" | 672 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 507 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" | 673 | checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" |
| 508 | dependencies = [ | 674 | dependencies = [ |
| 509 | "form_urlencoded", | 675 | "stable_deref_trait", |
| 510 | "idna", | 676 | "yoke-derive", |
| 511 | "matches", | 677 | "zerofrom", |
| 512 | "percent-encoding", | ||
| 513 | ] | 678 | ] |
| 514 | 679 | ||
| 515 | [[package]] | 680 | [[package]] |
| 516 | name = "windows-sys" | 681 | name = "yoke-derive" |
| 517 | version = "0.36.1" | 682 | version = "0.8.1" |
| 518 | source = "registry+https://github.com/rust-lang/crates.io-index" | 683 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 519 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" | 684 | checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" |
| 520 | dependencies = [ | 685 | dependencies = [ |
| 521 | "windows_aarch64_msvc", | 686 | "proc-macro2", |
| 522 | "windows_i686_gnu", | 687 | "quote", |
| 523 | "windows_i686_msvc", | 688 | "syn", |
| 524 | "windows_x86_64_gnu", | 689 | "synstructure", |
| 525 | "windows_x86_64_msvc", | ||
| 526 | ] | 690 | ] |
| 527 | 691 | ||
| 528 | [[package]] | 692 | [[package]] |
| 529 | name = "windows_aarch64_msvc" | 693 | name = "zerofrom" |
| 530 | version = "0.36.1" | 694 | version = "0.1.6" |
| 531 | source = "registry+https://github.com/rust-lang/crates.io-index" | 695 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 532 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" | 696 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" |
| 697 | dependencies = [ | ||
| 698 | "zerofrom-derive", | ||
| 699 | ] | ||
| 533 | 700 | ||
| 534 | [[package]] | 701 | [[package]] |
| 535 | name = "windows_i686_gnu" | 702 | name = "zerofrom-derive" |
| 536 | version = "0.36.1" | 703 | version = "0.1.6" |
| 537 | source = "registry+https://github.com/rust-lang/crates.io-index" | 704 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 538 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" | 705 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" |
| 706 | dependencies = [ | ||
| 707 | "proc-macro2", | ||
| 708 | "quote", | ||
| 709 | "syn", | ||
| 710 | "synstructure", | ||
| 711 | ] | ||
| 539 | 712 | ||
| 540 | [[package]] | 713 | [[package]] |
| 541 | name = "windows_i686_msvc" | 714 | name = "zerotrie" |
| 542 | version = "0.36.1" | 715 | version = "0.2.3" |
| 543 | source = "registry+https://github.com/rust-lang/crates.io-index" | 716 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 544 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" | 717 | checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" |
| 718 | dependencies = [ | ||
| 719 | "displaydoc", | ||
| 720 | "yoke", | ||
| 721 | "zerofrom", | ||
| 722 | ] | ||
| 545 | 723 | ||
| 546 | [[package]] | 724 | [[package]] |
| 547 | name = "windows_x86_64_gnu" | 725 | name = "zerovec" |
| 548 | version = "0.36.1" | 726 | version = "0.11.5" |
| 549 | source = "registry+https://github.com/rust-lang/crates.io-index" | 727 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 550 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" | 728 | checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" |
| 729 | dependencies = [ | ||
| 730 | "yoke", | ||
| 731 | "zerofrom", | ||
| 732 | "zerovec-derive", | ||
| 733 | ] | ||
| 551 | 734 | ||
| 552 | [[package]] | 735 | [[package]] |
| 553 | name = "windows_x86_64_msvc" | 736 | name = "zerovec-derive" |
| 554 | version = "0.36.1" | 737 | version = "0.11.2" |
| 555 | source = "registry+https://github.com/rust-lang/crates.io-index" | 738 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 556 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" | 739 | checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" |
| 740 | dependencies = [ | ||
| 741 | "proc-macro2", | ||
| 742 | "quote", | ||
| 743 | "syn", | ||
| 744 | ] | ||
| @@ -1,8 +1,8 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | publish = false | 2 | publish = false |
| 3 | name = "adblock" | 3 | name = "adblock" |
| 4 | version = "0.6.0" | 4 | version = "0.7.0" |
| 5 | edition = "2018" | 5 | edition = "2021" |
| 6 | authors = ["Árni Dagur <arni@dagur.eu>"] | 6 | authors = ["Árni Dagur <arni@dagur.eu>"] |
| 7 | license = "MIT OR Apache-2.0" | 7 | license = "MIT OR Apache-2.0" |
| 8 | readme = "README.md" | 8 | readme = "README.md" |
| @@ -13,9 +13,12 @@ repository = "https://github.com/ArniDagur/python-adblock" | |||
| 13 | debug = true | 13 | debug = true |
| 14 | 14 | ||
| 15 | [dependencies] | 15 | [dependencies] |
| 16 | adblock = { version = "=0.5.6", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } | 16 | adblock = { version = "0.11.1", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } |
| 17 | pyo3 = { version = "0.16", features = ["abi3-py37", "extension-module"] } | 17 | pyo3 = { version = "0.22", features = ["abi3-py38", "extension-module"] } |
| 18 | 18 | ||
| 19 | [lib] | 19 | [lib] |
| 20 | name = "adblock" | 20 | name = "adblock" |
| 21 | crate-type = ["rlib", "cdylib"] | 21 | crate-type = ["rlib", "cdylib"] |
| 22 | |||
| 23 | [[tool.maturin.python-packages]] | ||
| 24 | name = "adblock" | ||
diff --git a/pyproject.toml b/pyproject.toml index 564e100..24448ce 100644 --- a/pyproject.toml +++ b/pyproject.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [project] | 1 | [project] |
| 2 | name = "adblock" | 2 | name = "adblock" |
| 3 | version = "0.6.0" | 3 | version = "0.7.0" |
| 4 | description = "Brave's adblocking in Python" | 4 | description = "Brave's adblocking in Python" |
| 5 | requires-python = ">=3.7" | 5 | requires-python = ">=3.7" |
| 6 | authors = [{ name = "Árni Dagur", email = "arni@dagur.eu" }] | 6 | authors = [{ name = "Árni Dagur", email = "arni@dagur.eu" }] |
| @@ -13,7 +13,7 @@ classifiers = [ | |||
| 13 | 13 | ||
| 14 | [tool.poetry] | 14 | [tool.poetry] |
| 15 | name = "adblock" | 15 | name = "adblock" |
| 16 | version = "0.6.0" | 16 | version = "0.7.0" |
| 17 | description = "Brave's adblocking in Python" | 17 | description = "Brave's adblocking in Python" |
| 18 | authors = ["Árni Dagur <arni@dagur.eu>"] | 18 | authors = ["Árni Dagur <arni@dagur.eu>"] |
| 19 | 19 | ||
| @@ -12,21 +12,18 @@ | |||
| 12 | )] | 12 | )] |
| 13 | 13 | ||
| 14 | use adblock::blocker::BlockerResult as RustBlockerResult; | 14 | use adblock::blocker::BlockerResult as RustBlockerResult; |
| 15 | use adblock::blocker::{BlockerError as RustBlockerError, Redirection}; | ||
| 16 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; | 15 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; |
| 17 | use adblock::engine::Engine as RustEngine; | 16 | use adblock::engine::Engine as RustEngine; |
| 18 | use adblock::lists::FilterSet as RustFilterSet; | 17 | use adblock::lists::FilterSet as RustFilterSet; |
| 19 | use adblock::lists::{FilterFormat, ParseOptions, RuleTypes}; | 18 | use adblock::lists::{FilterFormat, ParseOptions, RuleTypes}; |
| 19 | use adblock::request::Request; | ||
| 20 | use pyo3::create_exception; | 20 | use pyo3::create_exception; |
| 21 | use pyo3::exceptions::PyException; | 21 | use pyo3::exceptions::PyException; |
| 22 | use pyo3::prelude::*; | 22 | use pyo3::prelude::*; |
| 23 | use pyo3::types::PyBytes; | 23 | use pyo3::types::PyBytes; |
| 24 | use pyo3::PyErr; | 24 | use pyo3::PyErr; |
| 25 | 25 | ||
| 26 | use adblock::resources::{ | 26 | use adblock::resources::{MimeType, PermissionMask, Resource, ResourceType}; |
| 27 | AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType, | ||
| 28 | }; | ||
| 29 | use std::collections::HashMap; | ||
| 30 | use std::collections::HashSet; | 27 | use std::collections::HashSet; |
| 31 | use std::error::Error; | 28 | use std::error::Error; |
| 32 | use std::fmt::{self, Display}; | 29 | use std::fmt::{self, Display}; |
| @@ -35,39 +32,39 @@ use std::io::{Read, Write}; | |||
| 35 | 32 | ||
| 36 | /// Brave's adblocking library in Python! | 33 | /// Brave's adblocking library in Python! |
| 37 | #[pymodule] | 34 | #[pymodule] |
| 38 | fn adblock(py: Python<'_>, m: &PyModule) -> PyResult<()> { | 35 | fn adblock_py(m: &Bound<'_, PyModule>) -> PyResult<()> { |
| 39 | m.add("__version__", env!("CARGO_PKG_VERSION"))?; | 36 | m.add("__version__", env!("CARGO_PKG_VERSION"))?; |
| 40 | m.add_class::<Engine>()?; | 37 | m.add_class::<Engine>()?; |
| 41 | m.add_class::<FilterSet>()?; | 38 | m.add_class::<FilterSet>()?; |
| 42 | m.add_class::<BlockerResult>()?; | 39 | m.add_class::<BlockerResult>()?; |
| 43 | m.add_class::<UrlSpecificResources>()?; | 40 | m.add_class::<UrlSpecificResources>()?; |
| 44 | m.add("AdblockException", py.get_type::<AdblockException>())?; | 41 | m.add("AdblockException", m.py().get_type_bound::<AdblockException>())?; |
| 45 | m.add("BlockerException", py.get_type::<BlockerException>())?; | 42 | m.add("BlockerException", m.py().get_type_bound::<BlockerException>())?; |
| 46 | m.add("SerializationError", py.get_type::<SerializationError>())?; | 43 | m.add("SerializationError", m.py().get_type_bound::<SerializationError>())?; |
| 47 | m.add( | 44 | m.add( |
| 48 | "DeserializationError", | 45 | "DeserializationError", |
| 49 | py.get_type::<DeserializationError>(), | 46 | m.py().get_type_bound::<DeserializationError>(), |
| 50 | )?; | 47 | )?; |
| 51 | m.add( | 48 | m.add( |
| 52 | "OptimizedFilterExistence", | 49 | "OptimizedFilterExistence", |
| 53 | py.get_type::<OptimizedFilterExistence>(), | 50 | m.py().get_type_bound::<OptimizedFilterExistence>(), |
| 54 | )?; | 51 | )?; |
| 55 | m.add( | 52 | m.add( |
| 56 | "BadFilterAddUnsupported", | 53 | "BadFilterAddUnsupported", |
| 57 | py.get_type::<BadFilterAddUnsupported>(), | 54 | m.py().get_type_bound::<BadFilterAddUnsupported>(), |
| 58 | )?; | 55 | )?; |
| 59 | m.add("FilterExists", py.get_type::<FilterExists>())?; | 56 | m.add("FilterExists", m.py().get_type_bound::<FilterExists>())?; |
| 60 | m.add( | 57 | m.add( |
| 61 | "AddResourceException", | 58 | "AddResourceException", |
| 62 | py.get_type::<AddResourceException>(), | 59 | m.py().get_type_bound::<AddResourceException>(), |
| 63 | )?; | 60 | )?; |
| 64 | m.add( | 61 | m.add( |
| 65 | "InvalidBase64ContentError", | 62 | "InvalidBase64ContentError", |
| 66 | py.get_type::<InvalidBase64ContentError>(), | 63 | m.py().get_type_bound::<InvalidBase64ContentError>(), |
| 67 | )?; | 64 | )?; |
| 68 | m.add( | 65 | m.add( |
| 69 | "InvalidUtf8ContentError", | 66 | "InvalidUtf8ContentError", |
| 70 | py.get_type::<InvalidUtf8ContentError>(), | 67 | m.py().get_type_bound::<InvalidUtf8ContentError>(), |
| 71 | )?; | 68 | )?; |
| 72 | Ok(()) | 69 | Ok(()) |
| 73 | } | 70 | } |
| @@ -94,14 +91,11 @@ pub struct BlockerResult { | |||
| 94 | /// | 91 | /// |
| 95 | /// [1]: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect | 92 | /// [1]: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect |
| 96 | #[pyo3(get)] | 93 | #[pyo3(get)] |
| 97 | pub redirect_type: Option<String>, | ||
| 98 | /// Exception is not `None` when the blocker matched on an exception rule. | ||
| 99 | /// Effectively this means that there was a match, but the request should | ||
| 100 | /// not be blocked. It is a non-empty string if the blocker was initialized | ||
| 101 | /// from a list of rules with debugging enabled, otherwise the original | ||
| 102 | /// string representation is discarded to reduce memory use. | ||
| 103 | #[pyo3(get)] | ||
| 104 | pub redirect: Option<String>, | 94 | pub redirect: Option<String>, |
| 95 | /// `removeparam` may remove URL parameters. If the original request URL was | ||
| 96 | /// modified at all, the new version will be here. | ||
| 97 | #[pyo3(get)] | ||
| 98 | pub rewritten_url: Option<String>, | ||
| 105 | /// Exception is not `None` when the blocker matched on an exception rule. | 99 | /// Exception is not `None` when the blocker matched on an exception rule. |
| 106 | /// Effectively this means that there was a match, but the request should | 100 | /// Effectively this means that there was a match, but the request should |
| 107 | /// not be blocked. It is a non-empty string if the blocker was initialized | 101 | /// not be blocked. It is a non-empty string if the blocker was initialized |
| @@ -114,32 +108,17 @@ pub struct BlockerResult { | |||
| 114 | /// a match, it is not `None`. | 108 | /// a match, it is not `None`. |
| 115 | #[pyo3(get)] | 109 | #[pyo3(get)] |
| 116 | pub filter: Option<String>, | 110 | pub filter: Option<String>, |
| 117 | /// The `error` field is only used to signal that there was an error in | ||
| 118 | /// parsing the provided URLs when using the simpler | ||
| 119 | /// `check_network_urls` method. | ||
| 120 | #[pyo3(get)] | ||
| 121 | pub error: Option<String>, | ||
| 122 | } | 111 | } |
| 123 | 112 | ||
| 124 | impl From<RustBlockerResult> for BlockerResult { | 113 | impl From<RustBlockerResult> for BlockerResult { |
| 125 | fn from(br: RustBlockerResult) -> Self { | 114 | fn from(br: RustBlockerResult) -> Self { |
| 126 | let (redirect, redirect_type) = if let Some(resource) = br.redirect { | ||
| 127 | match resource { | ||
| 128 | Redirection::Resource(resource) => (Some(resource), Some("resource".to_string())), | ||
| 129 | Redirection::Url(url) => (Some(url), Some("url".to_string())), | ||
| 130 | } | ||
| 131 | } else { | ||
| 132 | (None, None) | ||
| 133 | }; | ||
| 134 | |||
| 135 | Self { | 115 | Self { |
| 136 | matched: br.matched, | 116 | matched: br.matched, |
| 137 | important: br.important, | 117 | important: br.important, |
| 118 | redirect: br.redirect, | ||
| 119 | rewritten_url: br.rewritten_url, | ||
| 138 | exception: br.exception, | 120 | exception: br.exception, |
| 139 | filter: br.filter, | 121 | filter: br.filter, |
| 140 | error: br.error, | ||
| 141 | redirect_type, | ||
| 142 | redirect, | ||
| 143 | } | 122 | } |
| 144 | } | 123 | } |
| 145 | } | 124 | } |
| @@ -148,13 +127,13 @@ impl From<RustBlockerResult> for BlockerResult { | |||
| 148 | impl BlockerResult { | 127 | impl BlockerResult { |
| 149 | fn __repr__(&self) -> PyResult<String> { | 128 | fn __repr__(&self) -> PyResult<String> { |
| 150 | Ok(format!( | 129 | Ok(format!( |
| 151 | "BlockerResult(matched={}, important={}, redirect={}, exception={}, filter={}, error={})", | 130 | "BlockerResult(matched={}, important={}, redirect={}, rewritten_url={}, exception={}, filter={})", |
| 152 | self.matched.diy_python_repr(), | 131 | self.matched.diy_python_repr(), |
| 153 | self.important.diy_python_repr(), | 132 | self.important.diy_python_repr(), |
| 154 | self.redirect.diy_python_repr(), | 133 | self.redirect.diy_python_repr(), |
| 134 | self.rewritten_url.diy_python_repr(), | ||
| 155 | self.exception.diy_python_repr(), | 135 | self.exception.diy_python_repr(), |
| 156 | self.filter.diy_python_repr(), | 136 | self.filter.diy_python_repr(), |
| 157 | self.error.diy_python_repr(), | ||
| 158 | )) | 137 | )) |
| 159 | } | 138 | } |
| 160 | } | 139 | } |
| @@ -214,17 +193,6 @@ impl From<BlockerError> for PyErr { | |||
| 214 | } | 193 | } |
| 215 | } | 194 | } |
| 216 | 195 | ||
| 217 | impl From<RustBlockerError> for BlockerError { | ||
| 218 | fn from(err: RustBlockerError) -> Self { | ||
| 219 | match err { | ||
| 220 | RustBlockerError::SerializationError => Self::SerializationError, | ||
| 221 | RustBlockerError::DeserializationError => Self::DeserializationError, | ||
| 222 | RustBlockerError::OptimizedFilterExistence => Self::OptimizedFilterExistence, | ||
| 223 | RustBlockerError::BadFilterAddUnsupported => Self::BadFilterAddUnsupported, | ||
| 224 | RustBlockerError::FilterExists => Self::FilterExists, | ||
| 225 | } | ||
| 226 | } | ||
| 227 | } | ||
| 228 | 196 | ||
| 229 | fn filter_format_from_string(filter_format: &str) -> PyResult<FilterFormat> { | 197 | fn filter_format_from_string(filter_format: &str) -> PyResult<FilterFormat> { |
| 230 | match filter_format { | 198 | match filter_format { |
| @@ -252,7 +220,6 @@ fn rule_types_from_string(rule_types: &str) -> PyResult<RuleTypes> { | |||
| 252 | /// created. FilterSet allows assembling a compound list from multiple | 220 | /// created. FilterSet allows assembling a compound list from multiple |
| 253 | /// different sources before compiling the rules into an Engine. | 221 | /// different sources before compiling the rules into an Engine. |
| 254 | #[pyclass] | 222 | #[pyclass] |
| 255 | #[pyo3(text_signature = "($self, debug)")] | ||
| 256 | #[derive(Clone)] | 223 | #[derive(Clone)] |
| 257 | pub struct FilterSet { | 224 | pub struct FilterSet { |
| 258 | filter_set: RustFilterSet, | 225 | filter_set: RustFilterSet, |
| @@ -266,7 +233,7 @@ impl FilterSet { | |||
| 266 | /// the more compact internal representation. If enabled, this information | 233 | /// the more compact internal representation. If enabled, this information |
| 267 | /// will be passed to the corresponding Engine. | 234 | /// will be passed to the corresponding Engine. |
| 268 | #[new] | 235 | #[new] |
| 269 | #[args(debug = false)] | 236 | #[pyo3(signature = (debug = false))] |
| 270 | pub fn new(debug: bool) -> Self { | 237 | pub fn new(debug: bool) -> Self { |
| 271 | Self { | 238 | Self { |
| 272 | filter_set: RustFilterSet::new(debug), | 239 | filter_set: RustFilterSet::new(debug), |
| @@ -279,18 +246,11 @@ impl FilterSet { | |||
| 279 | /// | 246 | /// |
| 280 | /// The format is a string containing either "standard" (ABP/uBO-style) | 247 | /// The format is a string containing either "standard" (ABP/uBO-style) |
| 281 | /// or "hosts". | 248 | /// or "hosts". |
| 282 | #[pyo3(text_signature = "($self, filter_list, format, include_redirect_urls, rule_types)")] | 249 | #[pyo3(signature = (filter_list, format = "standard", rule_types = "all"))] |
| 283 | #[args( | ||
| 284 | filter_list, | ||
| 285 | format = "\"standard\"", | ||
| 286 | include_redirect_urls = "false", | ||
| 287 | rule_types = "\"all\"" | ||
| 288 | )] | ||
| 289 | pub fn add_filter_list( | 250 | pub fn add_filter_list( |
| 290 | &mut self, | 251 | &mut self, |
| 291 | filter_list: &str, | 252 | filter_list: &str, |
| 292 | format: &str, | 253 | format: &str, |
| 293 | include_redirect_urls: bool, | ||
| 294 | rule_types: &str, | 254 | rule_types: &str, |
| 295 | ) -> PyResult<()> { | 255 | ) -> PyResult<()> { |
| 296 | let filter_format = filter_format_from_string(format)?; | 256 | let filter_format = filter_format_from_string(format)?; |
| @@ -299,8 +259,8 @@ impl FilterSet { | |||
| 299 | filter_list, | 259 | filter_list, |
| 300 | ParseOptions { | 260 | ParseOptions { |
| 301 | format: filter_format, | 261 | format: filter_format, |
| 302 | include_redirect_urls, | ||
| 303 | rule_types, | 262 | rule_types, |
| 263 | permissions: PermissionMask::default(), | ||
| 304 | }, | 264 | }, |
| 305 | ); | 265 | ); |
| 306 | Ok(()) | 266 | Ok(()) |
| @@ -311,18 +271,11 @@ impl FilterSet { | |||
| 311 | /// | 271 | /// |
| 312 | /// The format is a string containing either "standard" (ABP/uBO-style) | 272 | /// The format is a string containing either "standard" (ABP/uBO-style) |
| 313 | /// or "hosts". | 273 | /// or "hosts". |
| 314 | #[pyo3(text_signature = "($self, filters, format, include_redirect_urls, rule_types)")] | 274 | #[pyo3(signature = (filters, format = "standard", rule_types = "all"))] |
| 315 | #[args( | ||
| 316 | filters, | ||
| 317 | format = "\"standard\"", | ||
| 318 | include_redirect_urls = "false", | ||
| 319 | rule_types = "\"all\"" | ||
| 320 | )] | ||
| 321 | pub fn add_filters( | 275 | pub fn add_filters( |
| 322 | &mut self, | 276 | &mut self, |
| 323 | filters: Vec<String>, | 277 | filters: Vec<String>, |
| 324 | format: &str, | 278 | format: &str, |
| 325 | include_redirect_urls: bool, | ||
| 326 | rule_types: &str, | 279 | rule_types: &str, |
| 327 | ) -> PyResult<()> { | 280 | ) -> PyResult<()> { |
| 328 | let filter_format = filter_format_from_string(format)?; | 281 | let filter_format = filter_format_from_string(format)?; |
| @@ -331,8 +284,8 @@ impl FilterSet { | |||
| 331 | &filters, | 284 | &filters, |
| 332 | ParseOptions { | 285 | ParseOptions { |
| 333 | format: filter_format, | 286 | format: filter_format, |
| 334 | include_redirect_urls, | ||
| 335 | rule_types, | 287 | rule_types, |
| 288 | permissions: PermissionMask::default(), | ||
| 336 | }, | 289 | }, |
| 337 | ); | 290 | ); |
| 338 | Ok(()) | 291 | Ok(()) |
| @@ -351,10 +304,9 @@ pub struct UrlSpecificResources { | |||
| 351 | /// styled as `{ display: none !important; }`. | 304 | /// styled as `{ display: none !important; }`. |
| 352 | #[pyo3(get)] | 305 | #[pyo3(get)] |
| 353 | pub hide_selectors: HashSet<String>, | 306 | pub hide_selectors: HashSet<String>, |
| 354 | /// A map of CSS selectors on the page to respective non-hide style rules, | 307 | /// Set of JSON-encoded procedural filters or filters with an action. |
| 355 | /// i.e. any required styles other than `display: none`. | ||
| 356 | #[pyo3(get)] | 308 | #[pyo3(get)] |
| 357 | pub style_selectors: HashMap<String, Vec<String>>, | 309 | pub procedural_actions: HashSet<String>, |
| 358 | /// A set of any class or id CSS selectors that should not have generic | 310 | /// A set of any class or id CSS selectors that should not have generic |
| 359 | /// rules applied. | 311 | /// rules applied. |
| 360 | // In practice, these should be passed to `class_id_stylesheet` and not | 312 | // In practice, these should be passed to `class_id_stylesheet` and not |
| @@ -376,7 +328,7 @@ impl From<RustUrlSpecificResources> for UrlSpecificResources { | |||
| 376 | fn from(r: RustUrlSpecificResources) -> Self { | 328 | fn from(r: RustUrlSpecificResources) -> Self { |
| 377 | Self { | 329 | Self { |
| 378 | hide_selectors: r.hide_selectors, | 330 | hide_selectors: r.hide_selectors, |
| 379 | style_selectors: r.style_selectors, | 331 | procedural_actions: r.procedural_actions, |
| 380 | exceptions: r.exceptions, | 332 | exceptions: r.exceptions, |
| 381 | injected_script: r.injected_script, | 333 | injected_script: r.injected_script, |
| 382 | generichide: r.generichide, | 334 | generichide: r.generichide, |
| @@ -388,9 +340,9 @@ impl From<RustUrlSpecificResources> for UrlSpecificResources { | |||
| 388 | impl UrlSpecificResources { | 340 | impl UrlSpecificResources { |
| 389 | fn __repr__(&self) -> PyResult<String> { | 341 | fn __repr__(&self) -> PyResult<String> { |
| 390 | Ok(format!( | 342 | Ok(format!( |
| 391 | "UrlSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={}, generichide={}>", | 343 | "UrlSpecificResources<{} hide selectors, {} procedural actions, {} exceptions, injected_javascript={}, generichide={}>", |
| 392 | self.hide_selectors.len(), | 344 | self.hide_selectors.len(), |
| 393 | self.style_selectors.len(), | 345 | self.procedural_actions.len(), |
| 394 | self.exceptions.len(), | 346 | self.exceptions.len(), |
| 395 | self.injected_script.diy_python_repr(), | 347 | self.injected_script.diy_python_repr(), |
| 396 | self.generichide.diy_python_repr(), | 348 | self.generichide.diy_python_repr(), |
| @@ -418,7 +370,6 @@ impl UrlSpecificResources { | |||
| 418 | /// | 370 | /// |
| 419 | /// [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType | 371 | /// [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType |
| 420 | #[pyclass] | 372 | #[pyclass] |
| 421 | #[pyo3(text_signature = "($self, filter_set, optimize)")] | ||
| 422 | pub struct Engine { | 373 | pub struct Engine { |
| 423 | engine: RustEngine, | 374 | engine: RustEngine, |
| 424 | optimize: bool, | 375 | optimize: bool, |
| @@ -428,7 +379,7 @@ pub struct Engine { | |||
| 428 | impl Engine { | 379 | impl Engine { |
| 429 | /// Create a new adblocking engine | 380 | /// Create a new adblocking engine |
| 430 | #[new] | 381 | #[new] |
| 431 | #[args(filter_set, optimize = true)] | 382 | #[pyo3(signature = (filter_set, optimize = true))] |
| 432 | pub fn new(filter_set: FilterSet, optimize: bool) -> Self { | 383 | pub fn new(filter_set: FilterSet, optimize: bool) -> Self { |
| 433 | let engine = RustEngine::from_filter_set(filter_set.filter_set, optimize); | 384 | let engine = RustEngine::from_filter_set(filter_set.filter_set, optimize); |
| 434 | Self { engine, optimize } | 385 | Self { engine, optimize } |
| @@ -442,17 +393,26 @@ impl Engine { | |||
| 442 | /// * `url` - The URL of the request to check | 393 | /// * `url` - The URL of the request to check |
| 443 | /// * `source_url` - The URL from where the request is made | 394 | /// * `source_url` - The URL from where the request is made |
| 444 | /// * `request_type` - The resource type that the request points to | 395 | /// * `request_type` - The resource type that the request points to |
| 445 | #[pyo3(text_signature = "($self, url, source_url, request_type)")] | ||
| 446 | pub fn check_network_urls( | 396 | pub fn check_network_urls( |
| 447 | &self, | 397 | &self, |
| 448 | url: &str, | 398 | url: &str, |
| 449 | source_url: &str, | 399 | source_url: &str, |
| 450 | request_type: &str, | 400 | request_type: &str, |
| 451 | ) -> BlockerResult { | 401 | ) -> BlockerResult { |
| 452 | let blocker_result = self | 402 | match Request::new(url, source_url, request_type) { |
| 453 | .engine | 403 | Ok(request) => { |
| 454 | .check_network_urls(url, source_url, request_type); | 404 | let blocker_result = self.engine.check_network_request(&request); |
| 455 | blocker_result.into() | 405 | blocker_result.into() |
| 406 | } | ||
| 407 | Err(_) => BlockerResult { | ||
| 408 | matched: false, | ||
| 409 | important: false, | ||
| 410 | redirect: None, | ||
| 411 | rewritten_url: None, | ||
| 412 | exception: None, | ||
| 413 | filter: None, | ||
| 414 | } | ||
| 415 | } | ||
| 456 | } | 416 | } |
| 457 | 417 | ||
| 458 | /// Check if a request should be blocked based on the given parameters. | 418 | /// Check if a request should be blocked based on the given parameters. |
| @@ -465,9 +425,7 @@ impl Engine { | |||
| 465 | /// * `third_party_request` - Is the given request to a third-party? Here, | 425 | /// * `third_party_request` - Is the given request to a third-party? Here, |
| 466 | /// `None` can be given and the engine will figure it out based on the | 426 | /// `None` can be given and the engine will figure it out based on the |
| 467 | /// `hostname` and `source_hostname`. | 427 | /// `hostname` and `source_hostname`. |
| 468 | #[pyo3( | 428 | #[pyo3(signature = (url, hostname, source_hostname, request_type, third_party_request = None))] |
| 469 | text_signature = "($self, url, hostname, source_hostname, requsest_type, third_party_request)" | ||
| 470 | )] | ||
| 471 | pub fn check_network_urls_with_hostnames( | 429 | pub fn check_network_urls_with_hostnames( |
| 472 | &self, | 430 | &self, |
| 473 | url: &str, | 431 | url: &str, |
| @@ -476,13 +434,11 @@ impl Engine { | |||
| 476 | request_type: &str, | 434 | request_type: &str, |
| 477 | third_party_request: Option<bool>, | 435 | third_party_request: Option<bool>, |
| 478 | ) -> BlockerResult { | 436 | ) -> BlockerResult { |
| 479 | let blocker_result = self.engine.check_network_urls_with_hostnames( | 437 | let third_party = third_party_request.unwrap_or_else(|| { |
| 480 | url, | 438 | hostname != source_hostname |
| 481 | hostname, | 439 | }); |
| 482 | source_hostname, | 440 | let request = Request::preparsed(url, hostname, source_hostname, request_type, third_party); |
| 483 | request_type, | 441 | let blocker_result = self.engine.check_network_request(&request); |
| 484 | third_party_request, | ||
| 485 | ); | ||
| 486 | blocker_result.into() | 442 | blocker_result.into() |
| 487 | } | 443 | } |
| 488 | 444 | ||
| @@ -499,10 +455,7 @@ impl Engine { | |||
| 499 | /// * `previously_matched_rule` - Return a match as long as there are no | 455 | /// * `previously_matched_rule` - Return a match as long as there are no |
| 500 | /// exceptions | 456 | /// exceptions |
| 501 | /// * `force_check_exceptions` - Check exceptions even if no other rule matches | 457 | /// * `force_check_exceptions` - Check exceptions even if no other rule matches |
| 502 | #[pyo3( | 458 | #[pyo3(signature = (url, hostname, source_hostname, request_type, third_party_request = None, previously_matched_rule = false, force_check_exceptions = false))] |
| 503 | text_signature = "($self, url, hostname, source_hostname, request_type, \ | ||
| 504 | third_party_request, previously_matched_rule, force_check_exceptions)" | ||
| 505 | )] | ||
| 506 | #[allow(clippy::too_many_arguments)] | 459 | #[allow(clippy::too_many_arguments)] |
| 507 | pub fn check_network_urls_with_hostnames_subset( | 460 | pub fn check_network_urls_with_hostnames_subset( |
| 508 | &self, | 461 | &self, |
| @@ -514,12 +467,12 @@ impl Engine { | |||
| 514 | previously_matched_rule: bool, | 467 | previously_matched_rule: bool, |
| 515 | force_check_exceptions: bool, | 468 | force_check_exceptions: bool, |
| 516 | ) -> BlockerResult { | 469 | ) -> BlockerResult { |
| 517 | let blocker_result = self.engine.check_network_urls_with_hostnames_subset( | 470 | let third_party = third_party_request.unwrap_or_else(|| { |
| 518 | url, | 471 | hostname != source_hostname |
| 519 | hostname, | 472 | }); |
| 520 | source_hostname, | 473 | let request = Request::preparsed(url, hostname, source_hostname, request_type, third_party); |
| 521 | request_type, | 474 | let blocker_result = self.engine.check_network_request_subset( |
| 522 | third_party_request, | 475 | &request, |
| 523 | previously_matched_rule, | 476 | previously_matched_rule, |
| 524 | force_check_exceptions, | 477 | force_check_exceptions, |
| 525 | ); | 478 | ); |
| @@ -534,7 +487,7 @@ impl Engine { | |||
| 534 | /// Use `"template"` if wanting to specify a template resource type. | 487 | /// Use `"template"` if wanting to specify a template resource type. |
| 535 | /// * `content`: The resource data, encoded using standard base64 configuration | 488 | /// * `content`: The resource data, encoded using standard base64 configuration |
| 536 | /// * `aliases`: List of aliases for the resource | 489 | /// * `aliases`: List of aliases for the resource |
| 537 | #[pyo3(text_signature = "($self, name, content_type, content, aliases)")] | 490 | #[pyo3(signature = (name, content_type, content, aliases = None))] |
| 538 | pub fn add_resource( | 491 | pub fn add_resource( |
| 539 | &mut self, | 492 | &mut self, |
| 540 | name: &str, | 493 | name: &str, |
| @@ -542,7 +495,7 @@ impl Engine { | |||
| 542 | content: &str, | 495 | content: &str, |
| 543 | aliases: Option<Vec<String>>, | 496 | aliases: Option<Vec<String>>, |
| 544 | ) -> PyResult<()> { | 497 | ) -> PyResult<()> { |
| 545 | let result = self.engine.add_resource(Resource { | 498 | let resource = Resource { |
| 546 | name: name.to_string(), | 499 | name: name.to_string(), |
| 547 | aliases: aliases.unwrap_or_default(), | 500 | aliases: aliases.unwrap_or_default(), |
| 548 | kind: match content_type { | 501 | kind: match content_type { |
| @@ -552,47 +505,27 @@ impl Engine { | |||
| 552 | ))), | 505 | ))), |
| 553 | }, | 506 | }, |
| 554 | content: content.to_string(), | 507 | content: content.to_string(), |
| 555 | }); | 508 | dependencies: Vec::new(), |
| 509 | permission: PermissionMask::default(), | ||
| 510 | }; | ||
| 556 | 511 | ||
| 557 | match result { | 512 | self.engine.use_resources(std::iter::once(resource)); |
| 558 | Ok(_) => Ok(()), | 513 | Ok(()) |
| 559 | Err(err) => match err { | ||
| 560 | RustAddResourceError::InvalidBase64Content => Err( | ||
| 561 | InvalidBase64ContentError::new_err("invalid base64 content".to_string()), | ||
| 562 | ), | ||
| 563 | RustAddResourceError::InvalidUtf8Content => Err(InvalidUtf8ContentError::new_err( | ||
| 564 | "invalid utf content".to_string(), | ||
| 565 | )), | ||
| 566 | }, | ||
| 567 | } | ||
| 568 | } | 514 | } |
| 569 | 515 | ||
| 570 | /// Serialize this blocking engine to bytes. They can then be deserialized | 516 | /// Serialize this blocking engine to bytes. They can then be deserialized |
| 571 | /// using `deserialize()` to get the same engine again. | 517 | /// using `deserialize()` to get the same engine again. |
| 572 | #[pyo3(text_signature = "($self)")] | 518 | pub fn serialize<'p>(&self, py: Python<'p>) -> PyResult<Bound<'p, PyBytes>> { |
| 573 | pub fn serialize<'p>(&mut self, py: Python<'p>) -> PyResult<&'p PyBytes> { | 519 | let bytes = self.engine.serialize(); |
| 574 | let bytes = self.serialize_inner()?; | 520 | let py_bytes = PyBytes::new_bound(py, &bytes); |
| 575 | let py_bytes = PyBytes::new(py, &bytes); | ||
| 576 | Ok(py_bytes) | 521 | Ok(py_bytes) |
| 577 | } | 522 | } |
| 578 | 523 | ||
| 579 | fn serialize_inner(&mut self) -> PyResult<Vec<u8>> { | ||
| 580 | let result = self.engine.serialize_raw(); | ||
| 581 | match result { | ||
| 582 | Ok(x) => Ok(x), | ||
| 583 | Err(error) => { | ||
| 584 | let my_blocker_error: BlockerError = error.into(); | ||
| 585 | Err(my_blocker_error.into()) | ||
| 586 | } | ||
| 587 | } | ||
| 588 | } | ||
| 589 | |||
| 590 | /// Serialize this blocking engine to a file. The file can then be | 524 | /// Serialize this blocking engine to a file. The file can then be |
| 591 | /// deserialized using `deserialize_from_file()` to get the same engine | 525 | /// deserialized using `deserialize_from_file()` to get the same engine |
| 592 | /// again. | 526 | /// again. |
| 593 | #[pyo3(text_signature = "($self, file)")] | 527 | pub fn serialize_to_file(&self, file: &str) -> PyResult<()> { |
| 594 | pub fn serialize_to_file(&mut self, file: &str) -> PyResult<()> { | 528 | let data = self.engine.serialize(); |
| 595 | let data = self.serialize_inner()?; | ||
| 596 | let mut fd = fs::OpenOptions::new() | 529 | let mut fd = fs::OpenOptions::new() |
| 597 | .create(true) | 530 | .create(true) |
| 598 | .truncate(true) | 531 | .truncate(true) |
| @@ -603,21 +536,14 @@ impl Engine { | |||
| 603 | } | 536 | } |
| 604 | 537 | ||
| 605 | /// Deserialize a blocking engine from bytes produced with `serialize()`. | 538 | /// Deserialize a blocking engine from bytes produced with `serialize()`. |
| 606 | #[pyo3(text_signature = "($self, serialized)")] | ||
| 607 | pub fn deserialize(&mut self, serialized: &[u8]) -> PyResult<()> { | 539 | pub fn deserialize(&mut self, serialized: &[u8]) -> PyResult<()> { |
| 608 | let result = self.engine.deserialize(serialized); | 540 | self.engine.deserialize(serialized).map_err(|_| { |
| 609 | match result { | 541 | DeserializationError::new_err("Failed to deserialize engine data") |
| 610 | Ok(_) => Ok(()), | 542 | }) |
| 611 | Err(error) => { | ||
| 612 | let my_blocker_error: BlockerError = error.into(); | ||
| 613 | Err(my_blocker_error.into()) | ||
| 614 | } | ||
| 615 | } | ||
| 616 | } | 543 | } |
| 617 | 544 | ||
| 618 | /// Deserialize a blocking engine from file produced with | 545 | /// Deserialize a blocking engine from file produced with |
| 619 | /// `serialize_to_file()`. | 546 | /// `serialize_to_file()`. |
| 620 | #[pyo3(text_signature = "($self, file)")] | ||
| 621 | pub fn deserialize_from_file(&mut self, file: &str) -> PyResult<()> { | 547 | pub fn deserialize_from_file(&mut self, file: &str) -> PyResult<()> { |
| 622 | let mut fd = fs::File::open(file)?; | 548 | let mut fd = fs::File::open(file)?; |
| 623 | let mut data: Vec<u8> = Vec::new(); | 549 | let mut data: Vec<u8> = Vec::new(); |
| @@ -626,18 +552,20 @@ impl Engine { | |||
| 626 | } | 552 | } |
| 627 | 553 | ||
| 628 | /// Checks if the given filter exists in the blocking engine. | 554 | /// Checks if the given filter exists in the blocking engine. |
| 629 | #[pyo3(text_signature = "($self, filter)")] | 555 | /// Note: This method has been removed in the latest version of adblock-rust. |
| 630 | pub fn filter_exists(&self, filter: &str) -> bool { | 556 | /// It will always return false. |
| 631 | self.engine.filter_exists(filter) | 557 | pub fn filter_exists(&self, _filter: &str) -> bool { |
| 558 | // This method no longer exists in the adblock-rust API | ||
| 559 | false | ||
| 632 | } | 560 | } |
| 633 | 561 | ||
| 634 | /// Sets this engine's tags to be _only_ the ones provided in tags. | 562 | /// Sets this engine's tags to be _only_ the ones provided in tags. |
| 635 | /// | 563 | /// |
| 636 | /// Tags can be used to cheaply enable or disable network rules with a | 564 | /// Tags can be used to cheaply enable or disable network rules with a |
| 637 | /// corresponding $tag option. | 565 | /// corresponding $tag option. |
| 638 | #[pyo3(text_signature = "($self, tags)")] | 566 | pub fn use_tags(&mut self, tags: Vec<String>) { |
| 639 | pub fn use_tags(&mut self, tags: Vec<&str>) { | 567 | let tag_refs: Vec<&str> = tags.iter().map(|s| s.as_str()).collect(); |
| 640 | self.engine.use_tags(&tags); | 568 | self.engine.use_tags(&tag_refs); |
| 641 | } | 569 | } |
| 642 | 570 | ||
| 643 | /// Sets this engine's tags to additionally include the ones provided in | 571 | /// Sets this engine's tags to additionally include the ones provided in |
| @@ -645,9 +573,9 @@ impl Engine { | |||
| 645 | /// | 573 | /// |
| 646 | /// Tags can be used to cheaply enable or disable network rules with a | 574 | /// Tags can be used to cheaply enable or disable network rules with a |
| 647 | /// corresponding $tag option. | 575 | /// corresponding $tag option. |
| 648 | #[pyo3(text_signature = "($self, tags)")] | 576 | pub fn enable_tags(&mut self, tags: Vec<String>) { |
| 649 | pub fn enable_tags(&mut self, tags: Vec<&str>) { | 577 | let tag_refs: Vec<&str> = tags.iter().map(|s| s.as_str()).collect(); |
| 650 | self.engine.enable_tags(&tags); | 578 | self.engine.enable_tags(&tag_refs); |
| 651 | } | 579 | } |
| 652 | 580 | ||
| 653 | /// Sets this engine's tags to no longer include the ones provided in | 581 | /// Sets this engine's tags to no longer include the ones provided in |
| @@ -655,16 +583,15 @@ impl Engine { | |||
| 655 | /// | 583 | /// |
| 656 | /// Tags can be used to cheaply enable or disable network rules with a | 584 | /// Tags can be used to cheaply enable or disable network rules with a |
| 657 | /// corresponding $tag option. | 585 | /// corresponding $tag option. |
| 658 | #[pyo3(text_signature = "($self, tags)")] | 586 | pub fn disable_tags(&mut self, tags: Vec<String>) { |
| 659 | pub fn disable_tags(&mut self, tags: Vec<&str>) { | 587 | let tag_refs: Vec<&str> = tags.iter().map(|s| s.as_str()).collect(); |
| 660 | self.engine.disable_tags(&tags); | 588 | self.engine.disable_tags(&tag_refs); |
| 661 | } | 589 | } |
| 662 | 590 | ||
| 663 | /// Checks if a given tag exists in this engine. | 591 | /// Checks if a given tag exists in this engine. |
| 664 | /// | 592 | /// |
| 665 | /// Tags can be used to cheaply enable or disable network rules with a | 593 | /// Tags can be used to cheaply enable or disable network rules with a |
| 666 | /// corresponding $tag option. | 594 | /// corresponding $tag option. |
| 667 | #[pyo3(text_signature = "($self, tag)")] | ||
| 668 | pub fn tag_exists(&self, tag: &str) -> bool { | 595 | pub fn tag_exists(&self, tag: &str) -> bool { |
| 669 | self.engine.tag_exists(tag) | 596 | self.engine.tag_exists(tag) |
| 670 | } | 597 | } |
| @@ -673,7 +600,6 @@ impl Engine { | |||
| 673 | /// url. Once this has been called, all CSS ids and classes on a | 600 | /// url. Once this has been called, all CSS ids and classes on a |
| 674 | /// page should be passed to hidden_class_id_selectors to obtain any | 601 | /// page should be passed to hidden_class_id_selectors to obtain any |
| 675 | /// stylesheets consisting of generic rules. | 602 | /// stylesheets consisting of generic rules. |
| 676 | #[pyo3(text_signature = "($self, url)")] | ||
| 677 | pub fn url_cosmetic_resources(&self, url: &str) -> UrlSpecificResources { | 603 | pub fn url_cosmetic_resources(&self, url: &str) -> UrlSpecificResources { |
| 678 | self.engine.url_cosmetic_resources(url).into() | 604 | self.engine.url_cosmetic_resources(url).into() |
| 679 | } | 605 | } |
| @@ -685,7 +611,6 @@ impl Engine { | |||
| 685 | /// are not excepted. | 611 | /// are not excepted. |
| 686 | /// | 612 | /// |
| 687 | /// Exceptions should be passed directly from UrlSpecificResources. | 613 | /// Exceptions should be passed directly from UrlSpecificResources. |
| 688 | #[pyo3(text_signature = "($self, classes, ids, exceptions)")] | ||
| 689 | pub fn hidden_class_id_selectors( | 614 | pub fn hidden_class_id_selectors( |
| 690 | &self, | 615 | &self, |
| 691 | classes: Vec<String>, | 616 | classes: Vec<String>, |
