summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml1
-rw-r--r--.gitignore7
-rw-r--r--CHANGELOG.md16
-rw-r--r--Cargo.lock1038
-rw-r--r--Cargo.toml4
-rw-r--r--pyproject.toml2
-rw-r--r--src/lib.rs25
7 files changed, 1068 insertions, 25 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 141fea4..a7074d4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,6 +26,7 @@ jobs:
26 uses: actions-rs/cargo@v1 26 uses: actions-rs/cargo@v1
27 with: 27 with:
28 command: fmt 28 command: fmt
29 args: -- --check
29 30
30 - name: Lint with clippy 31 - name: Lint with clippy
31 uses: actions-rs/cargo@v1 32 uses: actions-rs/cargo@v1
diff --git a/.gitignore b/.gitignore
index e7384ce..09fe806 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
1# -- Rust -- 1# -- Rust --
2/target 2/target
3Cargo.lock
4 3
5# -- Editors -- 4# -- Editors --
6# Created by https://www.gitignore.io/api/vim,emacs,visualstudiocode 5# Created by https://www.gitignore.io/api/vim,emacs,visualstudiocode
@@ -82,11 +81,7 @@ tags
82.vim 81.vim
83 82
84### VisualStudioCode ### 83### VisualStudioCode ###
85.vscode/* 84.vscode
86!.vscode/settings.json
87!.vscode/tasks.json
88!.vscode/launch.json
89!.vscode/extensions.json
90 85
91### VisualStudioCode Patch ### 86### VisualStudioCode Patch ###
92# Ignore all local history of files 87# Ignore all local history of files
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 63c9cd0..2bd8cfa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,11 +4,11 @@ All notable changes to this project will be documented in this file.
4This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Changelog](http://keepachangelog.com/). 4This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Changelog](http://keepachangelog.com/).
5 5
6 6
7
7## Unreleased 8## Unreleased
8--- 9---
9 10
10### New 11### New
11* Maintain a `CHANGELOG.md` file.
12 12
13### Changes 13### Changes
14 14
@@ -17,6 +17,20 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
17### Breaks 17### Breaks
18 18
19 19
20## 0.4.0 - (2020-12-16)
21---
22
23### New
24* Maintain a `CHANGELOG.md` file.
25* Include `generichide` field in `UrlSpecificResources`.
26
27### Fixes
28* Include `Cargo.lock` in source control, fixing incorrect dependency resolution [#15](https://github.com/ArniDagur/python-adblock/issues/15).
29
30### Breaks
31* Remove `explicit_cancel` field from `BlockerResult`, as it has been removed upstream.
32
33
20## 0.3.2 - (2020-09-22) 34## 0.3.2 - (2020-09-22)
21--- 35---
22 36
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..fe787aa
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,1038 @@
1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.
3[[package]]
4name = "adblock"
5version = "0.3.4"
6source = "registry+https://github.com/rust-lang/crates.io-index"
7checksum = "190544b3099ca6e26366898a4991fcb19d031d48ea36158e083543c56c1694b7"
8dependencies = [
9 "addr",
10 "base64",
11 "bitflags",
12 "flate2",
13 "idna 0.2.0",
14 "itertools",
15 "once_cell",
16 "percent-encoding 2.1.0",
17 "regex",
18 "rmp-serde",
19 "seahash",
20 "serde",
21 "twoway",
22 "url 2.2.0",
23]
24
25[[package]]
26name = "adblock"
27version = "0.4.0"
28dependencies = [
29 "adblock 0.3.4",
30 "pyo3",
31]
32
33[[package]]
34name = "addr"
35version = "0.2.0"
36source = "registry+https://github.com/rust-lang/crates.io-index"
37checksum = "22199dd03e5cff19ede8c2b835c93460f998b4716e225d06d740d925ceac5d75"
38dependencies = [
39 "error-chain",
40 "idna 0.1.5",
41 "lazy_static",
42 "psl",
43 "regex",
44 "rental",
45]
46
47[[package]]
48name = "addr2line"
49version = "0.14.0"
50source = "registry+https://github.com/rust-lang/crates.io-index"
51checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423"
52dependencies = [
53 "gimli",
54]
55
56[[package]]
57name = "adler"
58version = "0.2.3"
59source = "registry+https://github.com/rust-lang/crates.io-index"
60checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
61
62[[package]]
63name = "aho-corasick"
64version = "0.7.15"
65source = "registry+https://github.com/rust-lang/crates.io-index"
66checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
67dependencies = [
68 "memchr",
69]
70
71[[package]]
72name = "autocfg"
73version = "1.0.1"
74source = "registry+https://github.com/rust-lang/crates.io-index"
75checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
76
77[[package]]
78name = "backtrace"
79version = "0.3.55"
80source = "registry+https://github.com/rust-lang/crates.io-index"
81checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598"
82dependencies = [
83 "addr2line",
84 "cfg-if 1.0.0",
85 "libc",
86 "miniz_oxide",
87 "object",
88 "rustc-demangle",
89]
90
91[[package]]
92name = "base64"
93version = "0.13.0"
94source = "registry+https://github.com/rust-lang/crates.io-index"
95checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
96
97[[package]]
98name = "bitflags"
99version = "1.2.1"
100source = "registry+https://github.com/rust-lang/crates.io-index"
101checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
102
103[[package]]
104name = "byteorder"
105version = "1.3.4"
106source = "registry+https://github.com/rust-lang/crates.io-index"
107checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
108
109[[package]]
110name = "cc"
111version = "1.0.66"
112source = "registry+https://github.com/rust-lang/crates.io-index"
113checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"
114
115[[package]]
116name = "cfg-if"
117version = "0.1.10"
118source = "registry+https://github.com/rust-lang/crates.io-index"
119checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
120
121[[package]]
122name = "cfg-if"
123version = "1.0.0"
124source = "registry+https://github.com/rust-lang/crates.io-index"
125checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
126
127[[package]]
128name = "core-foundation"
129version = "0.9.1"
130source = "registry+https://github.com/rust-lang/crates.io-index"
131checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62"
132dependencies = [
133 "core-foundation-sys",
134 "libc",
135]
136
137[[package]]
138name = "core-foundation-sys"
139version = "0.8.2"
140source = "registry+https://github.com/rust-lang/crates.io-index"
141checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b"
142
143[[package]]
144name = "crc32fast"
145version = "1.2.1"
146source = "registry+https://github.com/rust-lang/crates.io-index"
147checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
148dependencies = [
149 "cfg-if 1.0.0",
150]
151
152[[package]]
153name = "ctor"
154version = "0.1.16"
155source = "registry+https://github.com/rust-lang/crates.io-index"
156checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484"
157dependencies = [
158 "quote 1.0.7",
159 "syn 1.0.54",
160]
161
162[[package]]
163name = "either"
164version = "1.6.1"
165source = "registry+https://github.com/rust-lang/crates.io-index"
166checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
167
168[[package]]
169name = "error-chain"
170version = "0.12.4"
171source = "registry+https://github.com/rust-lang/crates.io-index"
172checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc"
173dependencies = [
174 "backtrace",
175 "version_check",
176]
177
178[[package]]
179name = "flate2"
180version = "1.0.19"
181source = "registry+https://github.com/rust-lang/crates.io-index"
182checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129"
183dependencies = [
184 "cfg-if 1.0.0",
185 "crc32fast",
186 "libc",
187 "miniz_oxide",
188]
189
190[[package]]
191name = "foreign-types"
192version = "0.3.2"
193source = "registry+https://github.com/rust-lang/crates.io-index"
194checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
195dependencies = [
196 "foreign-types-shared",
197]
198
199[[package]]
200name = "foreign-types-shared"
201version = "0.1.1"
202source = "registry+https://github.com/rust-lang/crates.io-index"
203checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
204
205[[package]]
206name = "form_urlencoded"
207version = "1.0.0"
208source = "registry+https://github.com/rust-lang/crates.io-index"
209checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00"
210dependencies = [
211 "matches",
212 "percent-encoding 2.1.0",
213]
214
215[[package]]
216name = "getrandom"
217version = "0.1.15"
218source = "registry+https://github.com/rust-lang/crates.io-index"
219checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
220dependencies = [
221 "cfg-if 0.1.10",
222 "libc",
223 "wasi",
224]
225
226[[package]]
227name = "ghost"
228version = "0.1.2"
229source = "registry+https://github.com/rust-lang/crates.io-index"
230checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479"
231dependencies = [
232 "proc-macro2 1.0.24",
233 "quote 1.0.7",
234 "syn 1.0.54",
235]
236
237[[package]]
238name = "gimli"
239version = "0.23.0"
240source = "registry+https://github.com/rust-lang/crates.io-index"
241checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
242
243[[package]]
244name = "idna"
245version = "0.1.5"
246source = "registry+https://github.com/rust-lang/crates.io-index"
247checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
248dependencies = [
249 "matches",
250 "unicode-bidi",
251 "unicode-normalization",
252]
253
254[[package]]
255name = "idna"
256version = "0.2.0"
257source = "registry+https://github.com/rust-lang/crates.io-index"
258checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
259dependencies = [
260 "matches",
261 "unicode-bidi",
262 "unicode-normalization",
263]
264
265[[package]]
266name = "indoc"
267version = "0.3.6"
268source = "registry+https://github.com/rust-lang/crates.io-index"
269checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8"
270dependencies = [
271 "indoc-impl",
272 "proc-macro-hack",
273]
274
275[[package]]
276name = "indoc-impl"
277version = "0.3.6"
278source = "registry+https://github.com/rust-lang/crates.io-index"
279checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0"
280dependencies = [
281 "proc-macro-hack",
282 "proc-macro2 1.0.24",
283 "quote 1.0.7",
284 "syn 1.0.54",
285 "unindent",
286]
287
288[[package]]
289name = "instant"
290version = "0.1.9"
291source = "registry+https://github.com/rust-lang/crates.io-index"
292checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
293dependencies = [
294 "cfg-if 1.0.0",
295]
296
297[[package]]
298name = "inventory"
299version = "0.1.10"
300source = "registry+https://github.com/rust-lang/crates.io-index"
301checksum = "0f0f7efb804ec95e33db9ad49e4252f049e37e8b0a4652e3cd61f7999f2eff7f"
302dependencies = [
303 "ctor",
304 "ghost",
305 "inventory-impl",
306]
307
308[[package]]
309name = "inventory-impl"
310version = "0.1.10"
311source = "registry+https://github.com/rust-lang/crates.io-index"
312checksum = "75c094e94816723ab936484666968f5b58060492e880f3c8d00489a1e244fa51"
313dependencies = [
314 "proc-macro2 1.0.24",
315 "quote 1.0.7",
316 "syn 1.0.54",
317]
318
319[[package]]
320name = "itertools"
321version = "0.9.0"
322source = "registry+https://github.com/rust-lang/crates.io-index"
323checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
324dependencies = [
325 "either",
326]
327
328[[package]]
329name = "lazy_static"
330version = "1.4.0"
331source = "registry+https://github.com/rust-lang/crates.io-index"
332checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
333
334[[package]]
335name = "libc"
336version = "0.2.81"
337source = "registry+https://github.com/rust-lang/crates.io-index"
338checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
339
340[[package]]
341name = "lock_api"
342version = "0.4.2"
343source = "registry+https://github.com/rust-lang/crates.io-index"
344checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312"
345dependencies = [
346 "scopeguard",
347]
348
349[[package]]
350name = "log"
351version = "0.4.11"
352source = "registry+https://github.com/rust-lang/crates.io-index"
353checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
354dependencies = [
355 "cfg-if 0.1.10",
356]
357
358[[package]]
359name = "matches"
360version = "0.1.8"
361source = "registry+https://github.com/rust-lang/crates.io-index"
362checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
363
364[[package]]
365name = "memchr"
366version = "2.3.4"
367source = "registry+https://github.com/rust-lang/crates.io-index"
368checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
369
370[[package]]
371name = "miniz_oxide"
372version = "0.4.3"
373source = "registry+https://github.com/rust-lang/crates.io-index"
374checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
375dependencies = [
376 "adler",
377 "autocfg",
378]
379
380[[package]]
381name = "native-tls"
382version = "0.2.6"
383source = "registry+https://github.com/rust-lang/crates.io-index"
384checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f"
385dependencies = [
386 "lazy_static",
387 "libc",
388 "log",
389 "openssl",
390 "openssl-probe",
391 "openssl-sys",
392 "schannel",
393 "security-framework",
394 "security-framework-sys",
395 "tempfile",
396]
397
398[[package]]
399name = "num-traits"
400version = "0.2.14"
401source = "registry+https://github.com/rust-lang/crates.io-index"
402checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
403dependencies = [
404 "autocfg",
405]
406
407[[package]]
408name = "object"
409version = "0.22.0"
410source = "registry+https://github.com/rust-lang/crates.io-index"
411checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397"
412
413[[package]]
414name = "once_cell"
415version = "1.5.2"
416source = "registry+https://github.com/rust-lang/crates.io-index"
417checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0"
418
419[[package]]
420name = "openssl"
421version = "0.10.31"
422source = "registry+https://github.com/rust-lang/crates.io-index"
423checksum = "8d008f51b1acffa0d3450a68606e6a51c123012edaacb0f4e1426bd978869187"
424dependencies = [
425 "bitflags",
426 "cfg-if 1.0.0",
427 "foreign-types",
428 "lazy_static",
429 "libc",
430 "openssl-sys",
431]
432
433[[package]]
434name = "openssl-probe"
435version = "0.1.2"
436source = "registry+https://github.com/rust-lang/crates.io-index"
437checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
438
439[[package]]
440name = "openssl-sys"
441version = "0.9.59"
442source = "registry+https://github.com/rust-lang/crates.io-index"
443checksum = "de52d8eabd217311538a39bba130d7dea1f1e118010fee7a033d966845e7d5fe"
444dependencies = [
445 "autocfg",
446 "cc",
447 "libc",
448 "pkg-config",
449 "vcpkg",
450]
451
452[[package]]
453name = "parking_lot"
454version = "0.11.1"
455source = "registry+https://github.com/rust-lang/crates.io-index"
456checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
457dependencies = [
458 "instant",
459 "lock_api",
460 "parking_lot_core",
461]
462
463[[package]]
464name = "parking_lot_core"
465version = "0.8.1"
466source = "registry+https://github.com/rust-lang/crates.io-index"
467checksum = "d7c6d9b8427445284a09c55be860a15855ab580a417ccad9da88f5a06787ced0"
468dependencies = [
469 "cfg-if 1.0.0",
470 "instant",
471 "libc",
472 "redox_syscall",
473 "smallvec",
474 "winapi",
475]
476
477[[package]]
478name = "paste"
479version = "0.1.18"
480source = "registry+https://github.com/rust-lang/crates.io-index"
481checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
482dependencies = [
483 "paste-impl",
484 "proc-macro-hack",
485]
486
487[[package]]
488name = "paste-impl"
489version = "0.1.18"
490source = "registry+https://github.com/rust-lang/crates.io-index"
491checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
492dependencies = [
493 "proc-macro-hack",
494]
495
496[[package]]
497name = "percent-encoding"
498version = "1.0.1"
499source = "registry+https://github.com/rust-lang/crates.io-index"
500checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
501
502[[package]]
503name = "percent-encoding"
504version = "2.1.0"
505source = "registry+https://github.com/rust-lang/crates.io-index"
506checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
507
508[[package]]
509name = "pkg-config"
510version = "0.3.19"
511source = "registry+https://github.com/rust-lang/crates.io-index"
512checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
513
514[[package]]
515name = "ppv-lite86"
516version = "0.2.10"
517source = "registry+https://github.com/rust-lang/crates.io-index"
518checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
519
520[[package]]
521name = "proc-macro-hack"
522version = "0.5.19"
523source = "registry+https://github.com/rust-lang/crates.io-index"
524checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
525
526[[package]]
527name = "proc-macro2"
528version = "0.4.30"
529source = "registry+https://github.com/rust-lang/crates.io-index"
530checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
531dependencies = [
532 "unicode-xid 0.1.0",
533]
534
535[[package]]
536name = "proc-macro2"
537version = "1.0.24"
538source = "registry+https://github.com/rust-lang/crates.io-index"
539checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
540dependencies = [
541 "unicode-xid 0.2.1",
542]
543
544[[package]]
545name = "psl"
546version = "0.4.1"
547source = "registry+https://github.com/rust-lang/crates.io-index"
548checksum = "0fcd4da9d98f254ad641dd081207cc14fcbec95dd58ee62ffc9b96f0684fd6c2"
549dependencies = [
550 "psl-codegen",
551 "rustc_version",
552 "serde",
553]
554
555[[package]]
556name = "psl-codegen"
557version = "0.4.2"
558source = "registry+https://github.com/rust-lang/crates.io-index"
559checksum = "06f94f31e4f36b42e21b831d20bf0efc805b2155624697fb86f987b666518c3b"
560dependencies = [
561 "idna 0.1.5",
562 "proc-macro2 0.4.30",
563 "psl-lexer",
564 "quote 0.6.13",
565 "sequence_trie",
566 "syn 0.14.9",
567]
568
569[[package]]
570name = "psl-lexer"
571version = "0.2.0"
572source = "registry+https://github.com/rust-lang/crates.io-index"
573checksum = "6cf84fe23023e855b9a9d038a1b08d5c438d3961d2ced6c2b2358b29fbf74a63"
574dependencies = [
575 "error-chain",
576 "native-tls",
577 "url 1.7.2",
578]
579
580[[package]]
581name = "pyo3"
582version = "0.12.4"
583source = "registry+https://github.com/rust-lang/crates.io-index"
584checksum = "bf6bbbe8f70d179260b3728e5d04eb012f4f0c7988e58c11433dd689cecaa72e"
585dependencies = [
586 "ctor",
587 "indoc",
588 "inventory",
589 "libc",
590 "parking_lot",
591 "paste",
592 "pyo3cls",
593 "unindent",
594]
595
596[[package]]
597name = "pyo3-derive-backend"
598version = "0.12.4"
599source = "registry+https://github.com/rust-lang/crates.io-index"
600checksum = "10ecd0eb6ed7b3d9965b4f4370b5b9e99e3e5e8742000e1c452c018f8c2a322f"
601dependencies = [
602 "proc-macro2 1.0.24",
603 "quote 1.0.7",
604 "syn 1.0.54",
605]
606
607[[package]]
608name = "pyo3cls"
609version = "0.12.4"
610source = "registry+https://github.com/rust-lang/crates.io-index"
611checksum = "d344fdaa6a834a06dd1720ff104ea12fe101dad2e8db89345af9db74c0bb11a0"
612dependencies = [
613 "pyo3-derive-backend",
614 "quote 1.0.7",
615 "syn 1.0.54",
616]
617
618[[package]]
619name = "quote"
620version = "0.6.13"
621source = "registry+https://github.com/rust-lang/crates.io-index"
622checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
623dependencies = [
624 "proc-macro2 0.4.30",
625]
626
627[[package]]
628name = "quote"
629version = "1.0.7"
630source = "registry+https://github.com/rust-lang/crates.io-index"
631checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
632dependencies = [
633 "proc-macro2 1.0.24",
634]
635
636[[package]]
637name = "rand"
638version = "0.7.3"
639source = "registry+https://github.com/rust-lang/crates.io-index"
640checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
641dependencies = [
642 "getrandom",
643 "libc",
644 "rand_chacha",
645 "rand_core",
646 "rand_hc",
647]
648
649[[package]]
650name = "rand_chacha"
651version = "0.2.2"
652source = "registry+https://github.com/rust-lang/crates.io-index"
653checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
654dependencies = [
655 "ppv-lite86",
656 "rand_core",
657]
658
659[[package]]
660name = "rand_core"
661version = "0.5.1"
662source = "registry+https://github.com/rust-lang/crates.io-index"
663checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
664dependencies = [
665 "getrandom",
666]
667
668[[package]]
669name = "rand_hc"
670version = "0.2.0"
671source = "registry+https://github.com/rust-lang/crates.io-index"
672checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
673dependencies = [
674 "rand_core",
675]
676
677[[package]]
678name = "redox_syscall"
679version = "0.1.57"
680source = "registry+https://github.com/rust-lang/crates.io-index"
681checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
682
683[[package]]
684name = "regex"
685version = "1.4.2"
686source = "registry+https://github.com/rust-lang/crates.io-index"
687checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
688dependencies = [
689 "aho-corasick",
690 "memchr",
691 "regex-syntax",
692 "thread_local",
693]
694
695[[package]]
696name = "regex-syntax"
697version = "0.6.21"
698source = "registry+https://github.com/rust-lang/crates.io-index"
699checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
700
701[[package]]
702name = "remove_dir_all"
703version = "0.5.3"
704source = "registry+https://github.com/rust-lang/crates.io-index"
705checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
706dependencies = [
707 "winapi",
708]
709
710[[package]]
711name = "rental"
712version = "0.5.5"
713source = "registry+https://github.com/rust-lang/crates.io-index"
714checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"
715dependencies = [
716 "rental-impl",
717 "stable_deref_trait",
718]
719
720[[package]]
721name = "rental-impl"
722version = "0.5.5"
723source = "registry+https://github.com/rust-lang/crates.io-index"
724checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de"
725dependencies = [
726 "proc-macro2 1.0.24",
727 "quote 1.0.7",
728 "syn 1.0.54",
729]
730
731[[package]]
732name = "rmp"
733version = "0.8.9"
734source = "registry+https://github.com/rust-lang/crates.io-index"
735checksum = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f"
736dependencies = [
737 "byteorder",
738 "num-traits",
739]
740
741[[package]]
742name = "rmp-serde"
743version = "0.13.7"
744source = "registry+https://github.com/rust-lang/crates.io-index"
745checksum = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3"
746dependencies = [
747 "byteorder",
748 "rmp",
749 "serde",
750]
751
752[[package]]
753name = "rustc-demangle"
754version = "0.1.18"
755source = "registry+https://github.com/rust-lang/crates.io-index"
756checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
757
758[[package]]
759name = "rustc_version"
760version = "0.2.3"
761source = "registry+https://github.com/rust-lang/crates.io-index"
762checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
763dependencies = [
764 "semver",
765]
766
767[[package]]
768name = "schannel"
769version = "0.1.19"
770source = "registry+https://github.com/rust-lang/crates.io-index"
771checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75"
772dependencies = [
773 "lazy_static",
774 "winapi",
775]
776
777[[package]]
778name = "scopeguard"
779version = "1.1.0"
780source = "registry+https://github.com/rust-lang/crates.io-index"
781checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
782
783[[package]]
784name = "seahash"
785version = "3.0.7"
786source = "registry+https://github.com/rust-lang/crates.io-index"
787checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47"
788
789[[package]]
790name = "security-framework"
791version = "2.0.0"
792source = "registry+https://github.com/rust-lang/crates.io-index"
793checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69"
794dependencies = [
795 "bitflags",
796 "core-foundation",
797 "core-foundation-sys",
798 "libc",
799 "security-framework-sys",
800]
801
802[[package]]
803name = "security-framework-sys"
804version = "2.0.0"
805source = "registry+https://github.com/rust-lang/crates.io-index"
806checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b"
807dependencies = [
808 "core-foundation-sys",
809 "libc",
810]
811
812[[package]]
813name = "semver"
814version = "0.9.0"
815source = "registry+https://github.com/rust-lang/crates.io-index"
816checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
817dependencies = [
818 "semver-parser",
819]
820
821[[package]]
822name = "semver-parser"
823version = "0.7.0"
824source = "registry+https://github.com/rust-lang/crates.io-index"
825checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
826
827[[package]]
828name = "sequence_trie"
829version = "0.3.6"
830source = "registry+https://github.com/rust-lang/crates.io-index"
831checksum = "1ee22067b7ccd072eeb64454b9c6e1b33b61cd0d49e895fd48676a184580e0c3"
832
833[[package]]
834name = "serde"
835version = "1.0.118"
836source = "registry+https://github.com/rust-lang/crates.io-index"
837checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800"
838dependencies = [
839 "serde_derive",
840]
841
842[[package]]
843name = "serde_derive"
844version = "1.0.118"
845source = "registry+https://github.com/rust-lang/crates.io-index"
846checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df"
847dependencies = [
848 "proc-macro2 1.0.24",
849 "quote 1.0.7",
850 "syn 1.0.54",
851]
852
853[[package]]
854name = "smallvec"
855version = "1.5.1"
856source = "registry+https://github.com/rust-lang/crates.io-index"
857checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75"
858
859[[package]]
860name = "stable_deref_trait"
861version = "1.2.0"
862source = "registry+https://github.com/rust-lang/crates.io-index"
863checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
864
865[[package]]
866name = "syn"
867version = "0.14.9"
868source = "registry+https://github.com/rust-lang/crates.io-index"
869checksum = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
870dependencies = [
871 "proc-macro2 0.4.30",
872 "quote 0.6.13",
873 "unicode-xid 0.1.0",
874]
875
876[[package]]
877name = "syn"
878version = "1.0.54"
879source = "registry+https://github.com/rust-lang/crates.io-index"
880checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44"
881dependencies = [
882 "proc-macro2 1.0.24",
883 "quote 1.0.7",
884 "unicode-xid 0.2.1",
885]
886
887[[package]]
888name = "tempfile"
889version = "3.1.0"
890source = "registry+https://github.com/rust-lang/crates.io-index"
891checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
892dependencies = [
893 "cfg-if 0.1.10",
894 "libc",
895 "rand",
896 "redox_syscall",
897 "remove_dir_all",
898 "winapi",
899]
900
901[[package]]
902name = "thread_local"
903version = "1.0.1"
904source = "registry+https://github.com/rust-lang/crates.io-index"
905checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
906dependencies = [
907 "lazy_static",
908]
909
910[[package]]
911name = "tinyvec"
912version = "1.1.0"
913source = "registry+https://github.com/rust-lang/crates.io-index"
914checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f"
915dependencies = [
916 "tinyvec_macros",
917]
918
919[[package]]
920name = "tinyvec_macros"
921version = "0.1.0"
922source = "registry+https://github.com/rust-lang/crates.io-index"
923checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
924
925[[package]]
926name = "twoway"
927version = "0.2.1"
928source = "registry+https://github.com/rust-lang/crates.io-index"
929checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc"
930dependencies = [
931 "memchr",
932 "unchecked-index",
933]
934
935[[package]]
936name = "unchecked-index"
937version = "0.2.2"
938source = "registry+https://github.com/rust-lang/crates.io-index"
939checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
940
941[[package]]
942name = "unicode-bidi"
943version = "0.3.4"
944source = "registry+https://github.com/rust-lang/crates.io-index"
945checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
946dependencies = [
947 "matches",
948]
949
950[[package]]
951name = "unicode-normalization"
952version = "0.1.16"
953source = "registry+https://github.com/rust-lang/crates.io-index"
954checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606"
955dependencies = [
956 "tinyvec",
957]
958
959[[package]]
960name = "unicode-xid"
961version = "0.1.0"
962source = "registry+https://github.com/rust-lang/crates.io-index"
963checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
964
965[[package]]
966name = "unicode-xid"
967version = "0.2.1"
968source = "registry+https://github.com/rust-lang/crates.io-index"
969checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
970
971[[package]]
972name = "unindent"
973version = "0.1.7"
974source = "registry+https://github.com/rust-lang/crates.io-index"
975checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7"
976
977[[package]]
978name = "url"
979version = "1.7.2"
980source = "registry+https://github.com/rust-lang/crates.io-index"
981checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
982dependencies = [
983 "idna 0.1.5",
984 "matches",
985 "percent-encoding 1.0.1",
986]
987
988[[package]]
989name = "url"
990version = "2.2.0"
991source = "registry+https://github.com/rust-lang/crates.io-index"
992checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e"
993dependencies = [
994 "form_urlencoded",
995 "idna 0.2.0",
996 "matches",
997 "percent-encoding 2.1.0",
998]
999
1000[[package]]
1001name = "vcpkg"
1002version = "0.2.11"
1003source = "registry+https://github.com/rust-lang/crates.io-index"
1004checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
1005
1006[[package]]
1007name = "version_check"
1008version = "0.9.2"
1009source = "registry+https://github.com/rust-lang/crates.io-index"
1010checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1011
1012[[package]]
1013name = "wasi"
1014version = "0.9.0+wasi-snapshot-preview1"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
1016checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1017
1018[[package]]
1019name = "winapi"
1020version = "0.3.9"
1021source = "registry+https://github.com/rust-lang/crates.io-index"
1022checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1023dependencies = [
1024 "winapi-i686-pc-windows-gnu",
1025 "winapi-x86_64-pc-windows-gnu",
1026]
1027
1028[[package]]
1029name = "winapi-i686-pc-windows-gnu"
1030version = "0.4.0"
1031source = "registry+https://github.com/rust-lang/crates.io-index"
1032checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1033
1034[[package]]
1035name = "winapi-x86_64-pc-windows-gnu"
1036version = "0.4.0"
1037source = "registry+https://github.com/rust-lang/crates.io-index"
1038checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/Cargo.toml b/Cargo.toml
index 05d1891..372030b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
1[package] 1[package]
2name = "adblock" 2name = "adblock"
3publish = false 3publish = false
4version = "0.3.2" 4version = "0.4.0"
5authors = ["Árni Dagur <arni@dagur.eu"] 5authors = ["Árni Dagur <arni@dagur.eu"]
6edition = "2018" 6edition = "2018"
7license = "MIT OR Apache-2.0" 7license = "MIT OR Apache-2.0"
@@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
10debug = true 10debug = true
11 11
12[dependencies] 12[dependencies]
13adblock = { version = "0.3.2", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } 13adblock = { version = "=0.3.4", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] }
14pyo3 = "0.12" 14pyo3 = "0.12"
15 15
16[lib] 16[lib]
diff --git a/pyproject.toml b/pyproject.toml
index e383fb6..ceb5c2d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
1[tool.poetry] 1[tool.poetry]
2name = "adblock" 2name = "adblock"
3version = "0.3.2" 3version = "0.4.0"
4description = "Brave's adblocking in Python" 4description = "Brave's adblocking in Python"
5authors = ["Árni Dagur <arni@dagur.eu>"] 5authors = ["Árni Dagur <arni@dagur.eu>"]
6license = "MIT OR Apache-2.0" 6license = "MIT OR Apache-2.0"
diff --git a/src/lib.rs b/src/lib.rs
index fc837b8..bef0fb2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -45,11 +45,6 @@ fn adblock(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
45pub struct BlockerResult { 45pub struct BlockerResult {
46 #[pyo3(get)] 46 #[pyo3(get)]
47 pub matched: bool, 47 pub matched: bool,
48 /// Normally, Brave Browser returns `200 OK` with an empty body when
49 /// `matched` is `True`, except if `explicit_cancel` is also `True`, in
50 /// which case the request is cancelled.
51 #[pyo3(get)]
52 pub explicit_cancel: bool,
53 /// Important is used to signal that a rule with the `important` option 48 /// Important is used to signal that a rule with the `important` option
54 /// matched. An `important` match means that exceptions should not apply 49 /// matched. An `important` match means that exceptions should not apply
55 /// and no further checking is neccesary--the request should be blocked 50 /// and no further checking is neccesary--the request should be blocked
@@ -91,7 +86,6 @@ impl Into<BlockerResult> for RustBlockerResult {
91 fn into(self) -> BlockerResult { 86 fn into(self) -> BlockerResult {
92 BlockerResult { 87 BlockerResult {
93 matched: self.matched, 88 matched: self.matched,
94 explicit_cancel: self.explicit_cancel,
95 important: self.important, 89 important: self.important,
96 redirect: self.redirect, 90 redirect: self.redirect,
97 exception: self.exception, 91 exception: self.exception,
@@ -105,14 +99,8 @@ impl Into<BlockerResult> for RustBlockerResult {
105impl PyObjectProtocol for BlockerResult { 99impl PyObjectProtocol for BlockerResult {
106 fn __repr__(&self) -> PyResult<String> { 100 fn __repr__(&self) -> PyResult<String> {
107 Ok(format!( 101 Ok(format!(
108 "BlockerResult({}, {}, {}, {:?}, {:?}, {:?}, {:?})", 102 "BlockerResult({}, {}, {:?}, {:?}, {:?}, {:?})",
109 self.matched, 103 self.matched, self.important, self.redirect, self.exception, self.filter, self.error
110 self.explicit_cancel,
111 self.important,
112 self.redirect,
113 self.exception,
114 self.filter,
115 self.error
116 )) 104 ))
117 } 105 }
118} 106}
@@ -249,6 +237,11 @@ pub struct UrlSpecificResources {
249 /// page. 237 /// page.
250 #[pyo3(get)] 238 #[pyo3(get)]
251 pub injected_script: String, 239 pub injected_script: String,
240 /// `generichide` is set to `True` if there is a corresponding
241 /// `$generichide` exception network filter. If so, the page should not
242 /// query for additional generic rules using hidden_class_id_selectors.
243 #[pyo3(get)]
244 pub generichide: bool,
252} 245}
253 246
254impl Into<UrlSpecificResources> for RustUrlSpecificResources { 247impl Into<UrlSpecificResources> for RustUrlSpecificResources {
@@ -258,6 +251,7 @@ impl Into<UrlSpecificResources> for RustUrlSpecificResources {
258 style_selectors: self.style_selectors, 251 style_selectors: self.style_selectors,
259 exceptions: self.exceptions, 252 exceptions: self.exceptions,
260 injected_script: self.injected_script, 253 injected_script: self.injected_script,
254 generichide: self.generichide,
261 } 255 }
262 } 256 }
263} 257}
@@ -266,11 +260,12 @@ impl Into<UrlSpecificResources> for RustUrlSpecificResources {
266impl PyObjectProtocol for UrlSpecificResources { 260impl PyObjectProtocol for UrlSpecificResources {
267 fn __repr__(&self) -> PyResult<String> { 261 fn __repr__(&self) -> PyResult<String> {
268 Ok(format!( 262 Ok(format!(
269 "UrlSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={:?}>", 263 "UrlSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={:?}, generichide={}>",
270 self.hide_selectors.len(), 264 self.hide_selectors.len(),
271 self.style_selectors.len(), 265 self.style_selectors.len(),
272 self.exceptions.len(), 266 self.exceptions.len(),
273 self.injected_script, 267 self.injected_script,
268 self.generichide,
274 )) 269 ))
275 } 270 }
276} 271}