watchcat 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,494 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "0.7.20"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "bindgen"
16
+ version = "0.60.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
19
+ dependencies = [
20
+ "bitflags",
21
+ "cexpr",
22
+ "clang-sys",
23
+ "lazy_static",
24
+ "lazycell",
25
+ "peeking_take_while",
26
+ "proc-macro2",
27
+ "quote",
28
+ "regex",
29
+ "rustc-hash",
30
+ "shlex",
31
+ ]
32
+
33
+ [[package]]
34
+ name = "bitflags"
35
+ version = "1.3.2"
36
+ source = "registry+https://github.com/rust-lang/crates.io-index"
37
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
38
+
39
+ [[package]]
40
+ name = "cexpr"
41
+ version = "0.6.0"
42
+ source = "registry+https://github.com/rust-lang/crates.io-index"
43
+ checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
44
+ dependencies = [
45
+ "nom",
46
+ ]
47
+
48
+ [[package]]
49
+ name = "cfg-if"
50
+ version = "1.0.0"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
53
+
54
+ [[package]]
55
+ name = "clang-sys"
56
+ version = "1.4.0"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3"
59
+ dependencies = [
60
+ "glob",
61
+ "libc",
62
+ "libloading",
63
+ ]
64
+
65
+ [[package]]
66
+ name = "crossbeam-channel"
67
+ version = "0.5.6"
68
+ source = "registry+https://github.com/rust-lang/crates.io-index"
69
+ checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
70
+ dependencies = [
71
+ "cfg-if",
72
+ "crossbeam-utils",
73
+ ]
74
+
75
+ [[package]]
76
+ name = "crossbeam-utils"
77
+ version = "0.8.14"
78
+ source = "registry+https://github.com/rust-lang/crates.io-index"
79
+ checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
80
+ dependencies = [
81
+ "cfg-if",
82
+ ]
83
+
84
+ [[package]]
85
+ name = "filetime"
86
+ version = "0.2.19"
87
+ source = "registry+https://github.com/rust-lang/crates.io-index"
88
+ checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
89
+ dependencies = [
90
+ "cfg-if",
91
+ "libc",
92
+ "redox_syscall",
93
+ "windows-sys",
94
+ ]
95
+
96
+ [[package]]
97
+ name = "fsevent-sys"
98
+ version = "4.1.0"
99
+ source = "registry+https://github.com/rust-lang/crates.io-index"
100
+ checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
101
+ dependencies = [
102
+ "libc",
103
+ ]
104
+
105
+ [[package]]
106
+ name = "glob"
107
+ version = "0.3.1"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
110
+
111
+ [[package]]
112
+ name = "inotify"
113
+ version = "0.9.6"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
116
+ dependencies = [
117
+ "bitflags",
118
+ "inotify-sys",
119
+ "libc",
120
+ ]
121
+
122
+ [[package]]
123
+ name = "inotify-sys"
124
+ version = "0.1.5"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
127
+ dependencies = [
128
+ "libc",
129
+ ]
130
+
131
+ [[package]]
132
+ name = "kqueue"
133
+ version = "1.0.7"
134
+ source = "registry+https://github.com/rust-lang/crates.io-index"
135
+ checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98"
136
+ dependencies = [
137
+ "kqueue-sys",
138
+ "libc",
139
+ ]
140
+
141
+ [[package]]
142
+ name = "kqueue-sys"
143
+ version = "1.0.3"
144
+ source = "registry+https://github.com/rust-lang/crates.io-index"
145
+ checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587"
146
+ dependencies = [
147
+ "bitflags",
148
+ "libc",
149
+ ]
150
+
151
+ [[package]]
152
+ name = "lazy_static"
153
+ version = "1.4.0"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
156
+
157
+ [[package]]
158
+ name = "lazycell"
159
+ version = "1.3.0"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
162
+
163
+ [[package]]
164
+ name = "libc"
165
+ version = "0.2.139"
166
+ source = "registry+https://github.com/rust-lang/crates.io-index"
167
+ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
168
+
169
+ [[package]]
170
+ name = "libloading"
171
+ version = "0.7.4"
172
+ source = "registry+https://github.com/rust-lang/crates.io-index"
173
+ checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
174
+ dependencies = [
175
+ "cfg-if",
176
+ "winapi",
177
+ ]
178
+
179
+ [[package]]
180
+ name = "log"
181
+ version = "0.4.17"
182
+ source = "registry+https://github.com/rust-lang/crates.io-index"
183
+ checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
184
+ dependencies = [
185
+ "cfg-if",
186
+ ]
187
+
188
+ [[package]]
189
+ name = "magnus"
190
+ version = "0.4.4"
191
+ source = "registry+https://github.com/rust-lang/crates.io-index"
192
+ checksum = "fc87660cd7daa49fddbfd524c836de54d5c927d520cd163f43700c5087c57d6c"
193
+ dependencies = [
194
+ "magnus-macros",
195
+ "rb-sys",
196
+ "rb-sys-env",
197
+ ]
198
+
199
+ [[package]]
200
+ name = "magnus-macros"
201
+ version = "0.3.0"
202
+ source = "registry+https://github.com/rust-lang/crates.io-index"
203
+ checksum = "206cb23bfeea05180c97522ef6a3e52a4eb17b0ed2f30ee3ca9c4f994d2378ae"
204
+ dependencies = [
205
+ "proc-macro2",
206
+ "quote",
207
+ "syn",
208
+ ]
209
+
210
+ [[package]]
211
+ name = "memchr"
212
+ version = "2.5.0"
213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
214
+ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
215
+
216
+ [[package]]
217
+ name = "minimal-lexical"
218
+ version = "0.2.1"
219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
220
+ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
221
+
222
+ [[package]]
223
+ name = "mio"
224
+ version = "0.8.5"
225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
226
+ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
227
+ dependencies = [
228
+ "libc",
229
+ "log",
230
+ "wasi",
231
+ "windows-sys",
232
+ ]
233
+
234
+ [[package]]
235
+ name = "nom"
236
+ version = "7.1.3"
237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
238
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
239
+ dependencies = [
240
+ "memchr",
241
+ "minimal-lexical",
242
+ ]
243
+
244
+ [[package]]
245
+ name = "notify"
246
+ version = "5.1.0"
247
+ source = "registry+https://github.com/rust-lang/crates.io-index"
248
+ checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9"
249
+ dependencies = [
250
+ "bitflags",
251
+ "crossbeam-channel",
252
+ "filetime",
253
+ "fsevent-sys",
254
+ "inotify",
255
+ "kqueue",
256
+ "libc",
257
+ "mio",
258
+ "walkdir",
259
+ "windows-sys",
260
+ ]
261
+
262
+ [[package]]
263
+ name = "peeking_take_while"
264
+ version = "0.1.2"
265
+ source = "registry+https://github.com/rust-lang/crates.io-index"
266
+ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
267
+
268
+ [[package]]
269
+ name = "proc-macro2"
270
+ version = "1.0.51"
271
+ source = "registry+https://github.com/rust-lang/crates.io-index"
272
+ checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
273
+ dependencies = [
274
+ "unicode-ident",
275
+ ]
276
+
277
+ [[package]]
278
+ name = "quote"
279
+ version = "1.0.23"
280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
281
+ checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
282
+ dependencies = [
283
+ "proc-macro2",
284
+ ]
285
+
286
+ [[package]]
287
+ name = "rb-sys"
288
+ version = "0.9.63"
289
+ source = "registry+https://github.com/rust-lang/crates.io-index"
290
+ checksum = "55599c29a852b5ede44b5bd326fbe4a0d634fca5b50cfef0f9cbc3631f7c5ac0"
291
+ dependencies = [
292
+ "rb-sys-build",
293
+ ]
294
+
295
+ [[package]]
296
+ name = "rb-sys-build"
297
+ version = "0.9.63"
298
+ source = "registry+https://github.com/rust-lang/crates.io-index"
299
+ checksum = "24074524c6408f276cc254184c3475bd04c57d4eaa9938feea4440cb59b15703"
300
+ dependencies = [
301
+ "bindgen",
302
+ "regex",
303
+ "shell-words",
304
+ ]
305
+
306
+ [[package]]
307
+ name = "rb-sys-env"
308
+ version = "0.1.2"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
311
+
312
+ [[package]]
313
+ name = "redox_syscall"
314
+ version = "0.2.16"
315
+ source = "registry+https://github.com/rust-lang/crates.io-index"
316
+ checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
317
+ dependencies = [
318
+ "bitflags",
319
+ ]
320
+
321
+ [[package]]
322
+ name = "regex"
323
+ version = "1.7.1"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
326
+ dependencies = [
327
+ "aho-corasick",
328
+ "memchr",
329
+ "regex-syntax",
330
+ ]
331
+
332
+ [[package]]
333
+ name = "regex-syntax"
334
+ version = "0.6.28"
335
+ source = "registry+https://github.com/rust-lang/crates.io-index"
336
+ checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
337
+
338
+ [[package]]
339
+ name = "rustc-hash"
340
+ version = "1.1.0"
341
+ source = "registry+https://github.com/rust-lang/crates.io-index"
342
+ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
343
+
344
+ [[package]]
345
+ name = "same-file"
346
+ version = "1.0.6"
347
+ source = "registry+https://github.com/rust-lang/crates.io-index"
348
+ checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
349
+ dependencies = [
350
+ "winapi-util",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "shell-words"
355
+ version = "1.1.0"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
358
+
359
+ [[package]]
360
+ name = "shlex"
361
+ version = "1.1.0"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
364
+
365
+ [[package]]
366
+ name = "syn"
367
+ version = "1.0.107"
368
+ source = "registry+https://github.com/rust-lang/crates.io-index"
369
+ checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
370
+ dependencies = [
371
+ "proc-macro2",
372
+ "quote",
373
+ "unicode-ident",
374
+ ]
375
+
376
+ [[package]]
377
+ name = "unicode-ident"
378
+ version = "1.0.6"
379
+ source = "registry+https://github.com/rust-lang/crates.io-index"
380
+ checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
381
+
382
+ [[package]]
383
+ name = "walkdir"
384
+ version = "2.3.2"
385
+ source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
387
+ dependencies = [
388
+ "same-file",
389
+ "winapi",
390
+ "winapi-util",
391
+ ]
392
+
393
+ [[package]]
394
+ name = "wasi"
395
+ version = "0.11.0+wasi-snapshot-preview1"
396
+ source = "registry+https://github.com/rust-lang/crates.io-index"
397
+ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
398
+
399
+ [[package]]
400
+ name = "watchcat"
401
+ version = "0.1.0"
402
+ dependencies = [
403
+ "crossbeam-channel",
404
+ "magnus",
405
+ "notify",
406
+ ]
407
+
408
+ [[package]]
409
+ name = "winapi"
410
+ version = "0.3.9"
411
+ source = "registry+https://github.com/rust-lang/crates.io-index"
412
+ checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
413
+ dependencies = [
414
+ "winapi-i686-pc-windows-gnu",
415
+ "winapi-x86_64-pc-windows-gnu",
416
+ ]
417
+
418
+ [[package]]
419
+ name = "winapi-i686-pc-windows-gnu"
420
+ version = "0.4.0"
421
+ source = "registry+https://github.com/rust-lang/crates.io-index"
422
+ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
423
+
424
+ [[package]]
425
+ name = "winapi-util"
426
+ version = "0.1.5"
427
+ source = "registry+https://github.com/rust-lang/crates.io-index"
428
+ checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
429
+ dependencies = [
430
+ "winapi",
431
+ ]
432
+
433
+ [[package]]
434
+ name = "winapi-x86_64-pc-windows-gnu"
435
+ version = "0.4.0"
436
+ source = "registry+https://github.com/rust-lang/crates.io-index"
437
+ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
438
+
439
+ [[package]]
440
+ name = "windows-sys"
441
+ version = "0.42.0"
442
+ source = "registry+https://github.com/rust-lang/crates.io-index"
443
+ checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
444
+ dependencies = [
445
+ "windows_aarch64_gnullvm",
446
+ "windows_aarch64_msvc",
447
+ "windows_i686_gnu",
448
+ "windows_i686_msvc",
449
+ "windows_x86_64_gnu",
450
+ "windows_x86_64_gnullvm",
451
+ "windows_x86_64_msvc",
452
+ ]
453
+
454
+ [[package]]
455
+ name = "windows_aarch64_gnullvm"
456
+ version = "0.42.1"
457
+ source = "registry+https://github.com/rust-lang/crates.io-index"
458
+ checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
459
+
460
+ [[package]]
461
+ name = "windows_aarch64_msvc"
462
+ version = "0.42.1"
463
+ source = "registry+https://github.com/rust-lang/crates.io-index"
464
+ checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
465
+
466
+ [[package]]
467
+ name = "windows_i686_gnu"
468
+ version = "0.42.1"
469
+ source = "registry+https://github.com/rust-lang/crates.io-index"
470
+ checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
471
+
472
+ [[package]]
473
+ name = "windows_i686_msvc"
474
+ version = "0.42.1"
475
+ source = "registry+https://github.com/rust-lang/crates.io-index"
476
+ checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
477
+
478
+ [[package]]
479
+ name = "windows_x86_64_gnu"
480
+ version = "0.42.1"
481
+ source = "registry+https://github.com/rust-lang/crates.io-index"
482
+ checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
483
+
484
+ [[package]]
485
+ name = "windows_x86_64_gnullvm"
486
+ version = "0.42.1"
487
+ source = "registry+https://github.com/rust-lang/crates.io-index"
488
+ checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
489
+
490
+ [[package]]
491
+ name = "windows_x86_64_msvc"
492
+ version = "0.42.1"
493
+ source = "registry+https://github.com/rust-lang/crates.io-index"
494
+ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
@@ -0,0 +1,15 @@
1
+ [package]
2
+ name = "watchcat"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ publish = false
6
+
7
+ [lib]
8
+ crate-type = ["cdylib"]
9
+
10
+ [dependencies]
11
+ crossbeam-channel = "0.5.13"
12
+ magnus = "0.7"
13
+ notify = { version = "7.0.0", features = ["crossbeam-channel"] }
14
+ notify-debouncer-mini = { version = "0.5.0", features = ["crossbeam-channel"] }
15
+ rb-sys = "0.9.102"
@@ -0,0 +1,4 @@
1
+ require "mkmf"
2
+ require "rb_sys/mkmf"
3
+
4
+ create_rust_makefile "watchcat"
@@ -0,0 +1,135 @@
1
+ use notify::{
2
+ event::{
3
+ AccessKind, AccessMode, CreateKind, DataChange, MetadataKind, ModifyKind, RemoveKind,
4
+ RenameMode,
5
+ },
6
+ EventKind,
7
+ };
8
+
9
+ #[derive(Debug)]
10
+ pub enum WatchatEvent {}
11
+
12
+ impl WatchatEvent {
13
+ pub fn convert_kind(kind: &EventKind) -> Vec<String> {
14
+ let mut kinds = Vec::new();
15
+
16
+ match kind {
17
+ EventKind::Access(access_kind) => {
18
+ kinds.extend(Self::access_event(access_kind));
19
+ }
20
+ EventKind::Create(create_kind) => {
21
+ kinds.extend(Self::create_event(create_kind));
22
+ }
23
+ EventKind::Modify(modify_kind) => {
24
+ kinds.extend(Self::modify_event(modify_kind));
25
+ }
26
+ EventKind::Remove(remove_kind) => {
27
+ kinds.extend(Self::remove_event(remove_kind));
28
+ }
29
+ _ => {}
30
+ }
31
+
32
+ kinds
33
+ }
34
+
35
+ fn access_event(kind: &AccessKind) -> Vec<String> {
36
+ let mut kinds = Vec::new();
37
+ kinds.push("access".to_string());
38
+ match kind {
39
+ AccessKind::Read => {
40
+ kinds.push("read".to_string());
41
+ }
42
+ AccessKind::Open(access_mode) => {
43
+ kinds.push("open".to_string());
44
+ match access_mode {
45
+ AccessMode::Execute => {
46
+ kinds.push("execute".to_string());
47
+ }
48
+ AccessMode::Read => {
49
+ kinds.push("read".to_string());
50
+ }
51
+ AccessMode::Write => {
52
+ kinds.push("write".to_string());
53
+ }
54
+ _ => {}
55
+ }
56
+ }
57
+ AccessKind::Close(access_mode) => {
58
+ kinds.push("close".to_string());
59
+ match access_mode {
60
+ AccessMode::Execute => {
61
+ kinds.push("execute".to_string());
62
+ }
63
+ AccessMode::Read => {
64
+ kinds.push("read".to_string());
65
+ }
66
+ AccessMode::Write => {
67
+ kinds.push("write".to_string());
68
+ }
69
+ _ => {}
70
+ }
71
+ }
72
+ _ => {}
73
+ }
74
+ kinds
75
+ }
76
+
77
+ fn create_event(kind: &CreateKind) -> Vec<String> {
78
+ let mut kinds = Vec::new();
79
+ kinds.push("create".to_string());
80
+ match kind {
81
+ CreateKind::File => kinds.push("file".to_string()),
82
+ CreateKind::Folder => kinds.push("folder".to_string()),
83
+ _ => {}
84
+ }
85
+ kinds
86
+ }
87
+
88
+ fn modify_event(kind: &ModifyKind) -> Vec<String> {
89
+ let mut kinds = Vec::new();
90
+ kinds.push("modify".to_string());
91
+ match kind {
92
+ ModifyKind::Data(data_change) => {
93
+ kinds.push("data_change".to_string());
94
+ match data_change {
95
+ DataChange::Size => kinds.push("size".to_string()),
96
+ DataChange::Content => kinds.push("content".to_string()),
97
+ _ => {}
98
+ }
99
+ }
100
+ ModifyKind::Metadata(metadata_kind) => {
101
+ kinds.push("metadata".to_string());
102
+ match metadata_kind {
103
+ MetadataKind::AccessTime => kinds.push("access_time".to_string()),
104
+ MetadataKind::WriteTime => kinds.push("write_time".to_string()),
105
+ MetadataKind::Permissions => kinds.push("permissions".to_string()),
106
+ MetadataKind::Ownership => kinds.push("ownership".to_string()),
107
+ MetadataKind::Extended => kinds.push("extended".to_string()),
108
+ _ => {}
109
+ }
110
+ }
111
+ ModifyKind::Name(rename_mode) => {
112
+ kinds.push("rename".to_string());
113
+ match rename_mode {
114
+ RenameMode::From => kinds.push("from".to_string()),
115
+ RenameMode::To => kinds.push("to".to_string()),
116
+ RenameMode::Both => kinds.push("both".to_string()),
117
+ _ => {}
118
+ }
119
+ }
120
+ _ => {}
121
+ }
122
+ kinds
123
+ }
124
+
125
+ fn remove_event(kind: &RemoveKind) -> Vec<String> {
126
+ let mut kinds = Vec::new();
127
+ kinds.push("remove".to_string());
128
+ match kind {
129
+ RemoveKind::File => kinds.push("file".to_string()),
130
+ RemoveKind::Folder => kinds.push("folder".to_string()),
131
+ _ => {}
132
+ }
133
+ kinds
134
+ }
135
+ }