notify-types-2.0.0/.cargo_vcs_info.json0000644000000001520000000000100135030ustar { "git": { "sha1": "48541cb70fd4bcca131f39878194d0a22bb776f6" }, "path_in_vcs": "notify-types" }notify-types-2.0.0/Cargo.toml0000644000000023740000000000100115110ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.77" name = "notify-types" version = "2.0.0" authors = ["Daniel Faust "] description = "Types used by the notify crate" homepage = "https://github.com/notify-rs/notify" documentation = "https://docs.rs/notify-types" readme = "README.md" keywords = [ "events", "filesystem", "notify", "watch", ] categories = ["filesystem"] license = "MIT OR Apache-2.0" repository = "https://github.com/notify-rs/notify.git" [dependencies.serde] version = "1.0.89" features = ["derive"] optional = true [dependencies.web-time] version = "1.1.0" optional = true [dev-dependencies.insta] version = "1.34.0" [dev-dependencies.rstest] version = "0.24.0" [dev-dependencies.serde_json] version = "1.0.39" [features] serialization-compat-6 = [] notify-types-2.0.0/Cargo.toml.orig000064400000000000000000000012561046102023000151700ustar 00000000000000[package] name = "notify-types" version = "2.0.0" description = "Types used by the notify crate" documentation = "https://docs.rs/notify-types" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["events", "filesystem", "notify", "watch"] categories = ["filesystem"] authors = ["Daniel Faust "] rust-version.workspace = true edition.workspace = true homepage.workspace = true repository.workspace = true [features] serialization-compat-6 = [] [dependencies] serde = { workspace = true, optional = true } web-time = { workspace = true, optional = true } [dev-dependencies] serde_json.workspace = true insta.workspace = true rstest.workspace = true notify-types-2.0.0/LICENSE-APACHE000064400000000000000000000251271046102023000142300ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2023 Notify Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. notify-types-2.0.0/LICENSE-MIT000064400000000000000000000020471046102023000137340ustar 00000000000000Copyright (c) 2023 Notify Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. notify-types-2.0.0/README.md000064400000000000000000000073151046102023000135620ustar 00000000000000# Notify [![» Crate](https://flat.badgen.net/crates/v/notify)][crate] [![» Docs](https://flat.badgen.net/badge/api/docs.rs/df3600)][notify-docs] [![» CI](https://flat.badgen.net/github/checks/notify-rs/notify/main)][build] [![» Downloads](https://flat.badgen.net/crates/d/notify)][crate] [![» Conduct](https://flat.badgen.net/badge/contributor/covenant/5e0d73)][coc] [![» Public Domain](https://flat.badgen.net/badge/license/CC0-1.0/purple)][cc0] _Cross-platform filesystem notification library for Rust._ - [Notify Documentation][notify-docs] - [Notify Types Documentation][notify-types-docs] - [Mini Debouncer Documentation][debouncer-mini-docs] - [Full Debouncer Documentation][debouncer-full-docs] - [File ID][file-id-docs] - [Examples][examples] - [Changelog][changelog] - [Upgrading notify from v4](UPGRADING_V4_TO_V5.md) - Minimum supported Rust version: **1.77** As used by: [alacritty], [cargo watch], [cobalt], [deno], [docket], [mdBook], [rust-analyzer], [watchexec], [watchfiles], [xi-editor], and others. (Looking for desktop notifications instead? Have a look at [notify-rust] or [alert-after]!) ## Platforms - Linux / Android: inotify - macOS: FSEvents or kqueue, see features - Windows: ReadDirectoryChangesW - iOS / FreeBSD / NetBSD / OpenBSD / DragonflyBSD: kqueue - All platforms: polling ## License notify is licensed under the [CC Zero 1.0][cc0]. notify-types is licensed under the [MIT] or [Apache-2.0][apache] license. notify-debouncer-mini is licensed under the [MIT] or [Apache-2.0][apache] license. notify-debouncer-full is licensed under the [MIT] or [Apache-2.0][apache] license. file-id is licensed under the [MIT] or [Apache-2.0][apache] license. ## Origins Inspired by Go's [fsnotify] and Node.js's [Chokidar], born out of need for [cargo watch], and general frustration at the non-existence of C/Rust cross-platform notify libraries. Originally created by [Félix Saparelli] and awesome [contributors]. [Chokidar]: https://github.com/paulmillr/chokidar [FileSystemEventSecurity]: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/FileSystemEventSecurity/FileSystemEventSecurity.html [debouncer-full-docs]: https://docs.rs/notify-debouncer-full/latest/notify_debouncer_full/ [debouncer-mini-docs]: https://docs.rs/notify-debouncer-mini/latest/notify_debouncer_mini/ [Félix Saparelli]: https://passcod.name [alacritty]: https://github.com/jwilm/alacritty [alert-after]: https://github.com/frewsxcv/alert-after [build]: https://github.com/notify-rs/notify/actions [cargo watch]: https://github.com/passcod/cargo-watch [cc0]: ./notify/LICENSE-CC0 [MIT]: ./file-id/LICENSE-MIT [apache]: ./file-id/LICENSE-APACHE [changelog]: ./CHANGELOG.md [cobalt]: https://github.com/cobalt-org/cobalt.rs [coc]: http://contributor-covenant.org/version/1/4/ [contributors]: https://github.com/notify-rs/notify/graphs/contributors [crate]: https://crates.io/crates/notify [deno]: https://github.com/denoland/deno [docket]: https://iwillspeak.github.io/docket/ [notify-docs]: https://docs.rs/notify/latest/notify/ [notify-types-docs]: https://docs.rs/notify-types/latest/notify-types/ [file-id-docs]: https://docs.rs/file-id/latest/file-id/ [fsnotify]: https://github.com/fsnotify/fsnotify [handlebars-iron]: https://github.com/sunng87/handlebars-iron [hotwatch]: https://github.com/francesca64/hotwatch [mdBook]: https://github.com/rust-lang-nursery/mdBook [notify-rust]: https://github.com/hoodie/notify-rust [rust-analyzer]: https://github.com/rust-analyzer/rust-analyzer [serde]: https://serde.rs/ [watchexec]: https://github.com/mattgreen/watchexec [wiki]: https://github.com/notify-rs/notify/wiki [xi-editor]: https://xi-editor.io/ [watchfiles]: https://watchfiles.helpmanual.io/ [examples]: examples/ notify-types-2.0.0/src/debouncer_full.rs000064400000000000000000000014061046102023000164230ustar 00000000000000use std::ops::{Deref, DerefMut}; #[cfg(feature = "web-time")] use web_time::Instant; #[cfg(not(feature = "web-time"))] use std::time::Instant; use crate::event::Event; /// A debounced event is emitted after a short delay. #[derive(Debug, Clone, PartialEq, Eq)] pub struct DebouncedEvent { /// The original event. pub event: Event, /// The time at which the event occurred. pub time: Instant, } impl DebouncedEvent { pub fn new(event: Event, time: Instant) -> Self { Self { event, time } } } impl Deref for DebouncedEvent { type Target = Event; fn deref(&self) -> &Self::Target { &self.event } } impl DerefMut for DebouncedEvent { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.event } } notify-types-2.0.0/src/debouncer_mini.rs000064400000000000000000000016461046102023000164230ustar 00000000000000use std::path::PathBuf; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; /// A debounced event kind. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[non_exhaustive] pub enum DebouncedEventKind { /// No precise events Any, /// Event but debounce timed out (for example continuous writes) AnyContinuous, } /// A debounced event. /// /// Does not emit any specific event type on purpose, only distinguishes between an any event and a continuous any event. #[derive(Clone, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct DebouncedEvent { /// Event path pub path: PathBuf, /// Event kind pub kind: DebouncedEventKind, } impl DebouncedEvent { #[inline(always)] pub fn new(path: PathBuf, kind: DebouncedEventKind) -> Self { Self { path, kind } } } notify-types-2.0.0/src/event.rs000064400000000000000000000650671046102023000145710ustar 00000000000000//! The `Event` type and the hierarchical `EventKind` descriptor. use std::{ fmt, hash::{Hash, Hasher}, path::PathBuf, }; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; /// An event describing open or close operations on files. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum AccessMode { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when the file is executed, or the folder opened. Execute, /// An event emitted when the file is opened for reading. Read, /// An event emitted when the file is opened for writing. Write, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event describing non-mutating access operations on files. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "kind", content = "mode"))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum AccessKind { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when the file is read. Read, /// An event emitted when the file, or a handle to the file, is opened. Open(AccessMode), /// An event emitted when the file, or a handle to the file, is closed. Close(AccessMode), /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event describing creation operations on files. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "kind"))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum CreateKind { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event which results in the creation of a file. File, /// An event which results in the creation of a folder. Folder, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event emitted when the data content of a file is changed. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum DataChange { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when the size of the data is changed. Size, /// An event emitted when the content of the data is changed. Content, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event emitted when the metadata of a file or folder is changed. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum MetadataKind { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when the access time of the file or folder is changed. AccessTime, /// An event emitted when the write or modify time of the file or folder is changed. WriteTime, /// An event emitted when the permissions of the file or folder are changed. Permissions, /// An event emitted when the ownership of the file or folder is changed. Ownership, /// An event emitted when an extended attribute of the file or folder is changed. /// /// If the extended attribute's name or type is known, it should be provided in the /// `Info` event attribute. Extended, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event emitted when the name of a file or folder is changed. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum RenameMode { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted on the file or folder resulting from a rename. To, /// An event emitted on the file or folder that was renamed. From, /// A single event emitted with both the `From` and `To` paths. /// /// This event should be emitted when both source and target are known. The paths should be /// provided in this exact order (from, to). Both, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event describing mutation of content, name, or metadata. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "kind", content = "mode"))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum ModifyKind { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when the data content of a file is changed. Data(DataChange), /// An event emitted when the metadata of a file or folder is changed. Metadata(MetadataKind), /// An event emitted when the name of a file or folder is changed. #[cfg_attr(feature = "serde", serde(rename = "rename"))] Name(RenameMode), /// An event which specific kind is known but cannot be represented otherwise. Other, } /// An event describing removal operations on files. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "kind"))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] pub enum RemoveKind { /// The catch-all case, to be used when the specific kind of event is unknown. Any, /// An event emitted when a file is removed. File, /// An event emitted when a folder is removed. Folder, /// An event which specific kind is known but cannot be represented otherwise. Other, } /// Top-level event kind. /// /// This is arguably the most important classification for events. All subkinds below this one /// represent details that may or may not be available for any particular backend, but most tools /// and Notify systems will only care about which of these four general kinds an event is about. #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] #[cfg_attr( all(feature = "serde", not(feature = "serialization-compat-6")), serde(tag = "type") )] pub enum EventKind { /// The catch-all event kind, for unsupported/unknown events. /// /// This variant should be used as the "else" case when mapping native kernel bitmasks or /// bitmaps, such that if the mask is ever extended with new event types the backend will not /// gain bugs due to not matching new unknown event types. /// /// This variant is also the default variant used when Notify is in "imprecise" mode. #[default] Any, /// An event describing non-mutating access operations on files. /// /// This event is about opening and closing file handles, as well as executing files, and any /// other such event that is about accessing files, folders, or other structures rather than /// mutating them. /// /// Only some platforms are capable of generating these. Access(AccessKind), /// An event describing creation operations on files. /// /// This event is about the creation of files, folders, or other structures but not about e.g. /// writing new content into them. Create(CreateKind), /// An event describing mutation of content, name, or metadata. /// /// This event is about the mutation of files', folders', or other structures' content, name /// (path), or associated metadata (attributes). Modify(ModifyKind), /// An event describing removal operations on files. /// /// This event is about the removal of files, folders, or other structures but not e.g. erasing /// content from them. This may also be triggered for renames/moves that move files _out of the /// watched subpath_. /// /// Some editors also trigger Remove events when saving files as they may opt for removing (or /// renaming) the original then creating a new file in-place. Remove(RemoveKind), /// An event not fitting in any of the above four categories. /// /// This may be used for meta-events about the watch itself. Other, } impl EventKind { /// Indicates whether an event is an Access variant. pub fn is_access(&self) -> bool { matches!(self, EventKind::Access(_)) } /// Indicates whether an event is a Create variant. pub fn is_create(&self) -> bool { matches!(self, EventKind::Create(_)) } /// Indicates whether an event is a Modify variant. pub fn is_modify(&self) -> bool { matches!(self, EventKind::Modify(_)) } /// Indicates whether an event is a Remove variant. pub fn is_remove(&self) -> bool { matches!(self, EventKind::Remove(_)) } /// Indicates whether an event is an Other variant. pub fn is_other(&self) -> bool { matches!(self, EventKind::Other) } } /// Notify event. /// /// You might want to check [`Event::need_rescan`] to make sure no event was missed before you /// received this one. #[derive(Clone)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Event { /// Kind or type of the event. /// /// This is a hierarchy of enums describing the event as precisely as possible. All enums in /// the hierarchy have two variants always present, `Any` and `Other`, accompanied by one or /// more specific variants. /// /// `Any` should be used when more detail about the event is not known beyond the variant /// already selected. For example, `AccessMode::Any` means a file has been accessed, but that's /// all we know. /// /// `Other` should be used when more detail _is_ available, but cannot be encoded as one of the /// defined variants. When specifying `Other`, the event attributes should contain an `Info` /// entry with a short string identifying this detail. That string is to be considered part of /// the interface of the backend (i.e. a change should probably be breaking). /// /// For example, `CreateKind::Other` with an `Info("mount")` may indicate the binding of a /// mount. The documentation of the particular backend should indicate if any `Other` events /// are generated, and what their description means. /// /// The `EventKind::Any` variant should be used as the "else" case when mapping native kernel /// bitmasks or bitmaps, such that if the mask is ever extended with new event types the /// backend will not gain bugs due to not matching new unknown event types. #[cfg_attr( all(feature = "serde", not(feature = "serialization-compat-6")), serde(flatten) )] #[cfg_attr( all(feature = "serde", feature = "serialization-compat-6"), serde(rename = "type") )] pub kind: EventKind, /// Paths the event is about, if known. /// /// If an event concerns two or more paths, and the paths are known at the time of event /// creation, they should all go in this `Vec`. Otherwise, using the `Tracker` attr may be more /// appropriate. /// /// The order of the paths is likely to be significant! For example, renames where both ends of /// the name change are known will have the "source" path first, and the "target" path last. pub paths: Vec, // "What should be in the struct" and "what can go in the attrs" is an interesting question. // // Technically, the paths could go in the attrs. That would reduce the type size to 4 pointer // widths, instead of 7 like it is now. Anything 8 and below is probably good — on x64 that's // the size of an L1 cache line. The entire kind classification fits in 3 bytes, and an AnyMap // is 3 pointers. A Vec is another 3 pointers. // // Type size aside, what's behind these structures? A Vec and a PathBuf is stored on the heap. // An AnyMap is stored on the heap. But a Vec is directly there, requiring about one access to // get, while retrieving anything in the AnyMap requires some accesses as overhead. // // So things that are used often should be on the struct, and things that are used more rarely // should go in the attrs. Additionally, arbitrary data can _only_ go in the attrs. // // The kind and the paths vie for first place on this scale, depending on how downstream wishes // to use the information. Everything else is secondary. So far, that's why paths live here. // // In the future, it might be possible to have more data and to benchmark things properly, so // the performance can be actually quantified. Also, it might turn out that I have no idea what // I was talking about, so the above may be discarded or reviewed. We'll see! // /// Additional attributes of the event. /// /// Arbitrary data may be added to this field, without restriction beyond the `Sync` and /// `Clone` properties. Some data added here is considered for comparing and hashing, but not /// all: at this writing this is `Tracker`, `Flag`, `Info`, and `Source`. #[cfg_attr(feature = "serde", serde(default))] pub attrs: EventAttributes, } /// Additional attributes of the event. #[derive(Clone, Default, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct EventAttributes { #[cfg_attr(feature = "serde", serde(flatten))] inner: Option>, } #[derive(Clone, Default, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] struct EventAttributesInner { /// Tracking ID for events that are related. /// /// For events generated by backends with the `TrackRelated` capability. Those backends _may_ /// emit events that are related to each other, and tag those with an identical "tracking id" /// or "cookie". The value is normalised to `usize`. #[cfg_attr( feature = "serde", serde(default, skip_serializing_if = "Option::is_none") )] tracker: Option, /// Special Notify flag on the event. #[cfg_attr( feature = "serde", serde(default, skip_serializing_if = "Option::is_none") )] flag: Option, /// Additional information on the event. /// /// This is to be used for all `Other` variants of the event kind hierarchy. The variant /// indicates that a consumer should look into the `attrs` for an `Info` value; if that value /// is missing it should be considered a backend bug. /// /// This attribute may also be present for non-`Other` variants of the event kind, if doing so /// provides useful precision. For example, the `Modify(Metadata(Extended))` kind suggests /// using this attribute when information about _what_ extended metadata changed is available. /// /// This should be a short string, and changes may be considered breaking. #[cfg_attr( feature = "serde", serde(default, skip_serializing_if = "Option::is_none") )] info: Option, /// The source of the event. /// /// In most cases this should be a short string, identifying the backend unambiguously. In some /// cases this may be dynamically generated, but should contain a prefix to make it unambiguous /// between backends. #[cfg_attr( feature = "serde", serde(default, skip_serializing_if = "Option::is_none") )] source: Option, /// The process ID of the originator of the event. /// /// This attribute is experimental and, while included in Notify itself, is not considered /// stable or standard enough to be part of the serde, eq, hash, and debug representations. #[cfg_attr( feature = "serde", serde(default, skip_serializing, skip_deserializing) )] process_id: Option, } impl EventAttributes { /// Creates a new `EventAttributes`. pub fn new() -> Self { Self { inner: None } } /// Retrieves the tracker ID for an event directly, if present. pub fn tracker(&self) -> Option { self.inner.as_ref().and_then(|inner| inner.tracker) } /// Retrieves the Notify flag for an event directly, if present. pub fn flag(&self) -> Option { self.inner.as_ref().and_then(|inner| inner.flag) } /// Retrieves the additional info for an event directly, if present. pub fn info(&self) -> Option<&str> { self.inner.as_ref().and_then(|inner| inner.info.as_deref()) } /// Retrieves the source for an event directly, if present. pub fn source(&self) -> Option<&str> { self.inner .as_ref() .and_then(|inner| inner.source.as_deref()) } /// The process ID of the originator of the event. /// /// This attribute is experimental and, while included in Notify itself, is not considered /// stable or standard enough to be part of the serde, eq, hash, and debug representations. pub fn process_id(&self) -> Option { self.inner.as_ref().and_then(|inner| inner.process_id) } /// Sets the tracker. pub fn set_tracker(&mut self, tracker: usize) { self.inner_mut().tracker = Some(tracker); } /// Sets the Notify flag onto the event. pub fn set_flag(&mut self, flag: Flag) { self.inner_mut().flag = Some(flag); } /// Sets additional info onto the event. pub fn set_info(&mut self, info: &str) { self.inner_mut().info = Some(info.to_string()); } /// Sets the process id onto the event. pub fn set_process_id(&mut self, process_id: u32) { self.inner_mut().process_id = Some(process_id) } fn inner_mut(&mut self) -> &mut EventAttributesInner { self.inner.get_or_insert_with(Box::default) } } /// Special Notify flag on the event. /// /// This attribute is used to flag certain kinds of events that Notify either marks or generates in /// particular ways. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] #[cfg_attr( all(feature = "serde", not(feature = "serialization-compat-6")), serde(rename_all = "camelCase") )] pub enum Flag { /// Rescan notices are emitted by some platforms (and may also be emitted by Notify itself). /// They indicate either a lapse in the events or a change in the filesystem such that events /// received so far can no longer be relied on to represent the state of the filesystem now. /// /// An application that simply reacts to file changes may not care about this. An application /// that keeps an in-memory representation of the filesystem will need to care, and will need /// to refresh that representation directly from the filesystem. Rescan, } impl Event { /// Returns whether some events may have been missed. If true, you should assume any file or /// folder might have been modified. /// /// See [`Flag::Rescan`] for more information. pub fn need_rescan(&self) -> bool { matches!(self.flag(), Some(Flag::Rescan)) } /// Retrieves the tracker ID for an event directly, if present. pub fn tracker(&self) -> Option { self.attrs.tracker() } /// Retrieves the Notify flag for an event directly, if present. pub fn flag(&self) -> Option { self.attrs.flag() } /// Retrieves the additional info for an event directly, if present. pub fn info(&self) -> Option<&str> { self.attrs.info() } /// Retrieves the source for an event directly, if present. pub fn source(&self) -> Option<&str> { self.attrs.source() } /// Creates a new `Event` given a kind. pub fn new(kind: EventKind) -> Self { Self { kind, paths: Vec::new(), attrs: EventAttributes::new(), } } /// Sets the kind. pub fn set_kind(mut self, kind: EventKind) -> Self { self.kind = kind; self } /// Adds a path to the event. pub fn add_path(mut self, path: PathBuf) -> Self { self.paths.push(path); self } /// Adds a path to the event if the argument is Some. pub fn add_some_path(self, path: Option) -> Self { if let Some(path) = path { self.add_path(path) } else { self } } /// Sets the tracker. pub fn set_tracker(mut self, tracker: usize) -> Self { self.attrs.set_tracker(tracker); self } /// Sets additional info onto the event. pub fn set_info(mut self, info: &str) -> Self { self.attrs.set_info(info); self } /// Sets the Notify flag onto the event. pub fn set_flag(mut self, flag: Flag) -> Self { self.attrs.set_flag(flag); self } /// Sets the process id onto the event. pub fn set_process_id(mut self, process_id: u32) -> Self { self.attrs.set_process_id(process_id); self } } impl fmt::Debug for Event { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Event") .field("kind", &self.kind) .field("paths", &self.paths) .field("attr:tracker", &self.tracker()) .field("attr:flag", &self.flag()) .field("attr:info", &self.info()) .field("attr:source", &self.source()) .finish() } } impl Default for Event { fn default() -> Self { Self { kind: EventKind::default(), paths: Vec::new(), attrs: EventAttributes::new(), } } } impl Eq for Event {} impl PartialEq for Event { fn eq(&self, other: &Self) -> bool { self.kind.eq(&other.kind) && self.paths.eq(&other.paths) && self.tracker().eq(&other.tracker()) && self.flag().eq(&other.flag()) && self.info().eq(&other.info()) && self.source().eq(&other.source()) } } impl Hash for Event { fn hash(&self, state: &mut H) { self.kind.hash(state); self.paths.hash(state); self.tracker().hash(state); self.flag().hash(state); self.info().hash(state); self.source().hash(state); } } #[cfg(all(test, feature = "serde", not(feature = "serialization-compat-6")))] mod tests { use super::*; use insta::assert_snapshot; use rstest::rstest; #[rustfmt::skip] #[rstest] #[case("any", EventKind::Any)] #[case("access-any", EventKind::Access(AccessKind::Any))] #[case("access-read", EventKind::Access(AccessKind::Read))] #[case("access-open-any", EventKind::Access(AccessKind::Open(AccessMode::Any)))] #[case("access-open-execute", EventKind::Access(AccessKind::Open(AccessMode::Execute)))] #[case("access-open-read", EventKind::Access(AccessKind::Open(AccessMode::Read)))] #[case("access-open-write", EventKind::Access(AccessKind::Open(AccessMode::Write)))] #[case("access-open-other", EventKind::Access(AccessKind::Open(AccessMode::Other)))] #[case("access-close-any", EventKind::Access(AccessKind::Close(AccessMode::Any)))] #[case("access-close-execute", EventKind::Access(AccessKind::Close(AccessMode::Execute)))] #[case("access-close-read", EventKind::Access(AccessKind::Close(AccessMode::Read)))] #[case("access-close-write", EventKind::Access(AccessKind::Close(AccessMode::Write)))] #[case("access-close-other", EventKind::Access(AccessKind::Close(AccessMode::Other)))] #[case("access-other", EventKind::Access(AccessKind::Other))] #[case("create-any", EventKind::Create(CreateKind::Any))] #[case("create-file", EventKind::Create(CreateKind::File))] #[case("create-folder", EventKind::Create(CreateKind::Folder))] #[case("create-other", EventKind::Create(CreateKind::Other))] #[case("modify-any", EventKind::Modify(ModifyKind::Any))] #[case("modify-data-any", EventKind::Modify(ModifyKind::Data(DataChange::Any)))] #[case("modify-data-size", EventKind::Modify(ModifyKind::Data(DataChange::Size)))] #[case("modify-data-content", EventKind::Modify(ModifyKind::Data(DataChange::Content)))] #[case("modify-data-other", EventKind::Modify(ModifyKind::Data(DataChange::Other)))] #[case("modify-metadata-any", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Any)))] #[case("modify-metadata-accesstime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::AccessTime)))] #[case("modify-metadata-writetime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::WriteTime)))] #[case("modify-metadata-permissions", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Permissions)))] #[case("modify-metadata-ownership", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Ownership)))] #[case("modify-metadata-extended", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Extended)))] #[case("modify-metadata-other", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Other)))] #[case("modify-name-any", EventKind::Modify(ModifyKind::Name(RenameMode::Any)))] #[case("modify-name-to", EventKind::Modify(ModifyKind::Name(RenameMode::To)))] #[case("modify-name-from", EventKind::Modify(ModifyKind::Name(RenameMode::From)))] #[case("modify-name-both", EventKind::Modify(ModifyKind::Name(RenameMode::Both)))] #[case("modify-name-other", EventKind::Modify(ModifyKind::Name(RenameMode::Other)))] #[case("modify-other", EventKind::Modify(ModifyKind::Other))] #[case("remove-any", EventKind::Remove(RemoveKind::Any))] #[case("remove-file", EventKind::Remove(RemoveKind::File))] #[case("remove-folder", EventKind::Remove(RemoveKind::Folder))] #[case("remove-other", EventKind::Remove(RemoveKind::Other))] #[case("other", EventKind::Other)] fn serialize_event_kind( #[case] name: &str, #[case] event_kind: EventKind, ) { let event = Event::new(event_kind); let json = serde_json::to_string(&event).unwrap(); assert_snapshot!(name, json); } #[test] fn serialize_event_with_attrs() { let event = Event::new(EventKind::Any) .set_tracker(123) .set_flag(Flag::Rescan) .set_info("test event") .set_process_id(0); let json = serde_json::to_string(&event).unwrap(); assert_snapshot!(json); } } notify-types-2.0.0/src/lib.rs000064400000000000000000000020771046102023000142060ustar 00000000000000pub mod debouncer_full; pub mod debouncer_mini; pub mod event; #[cfg(test)] mod tests { use super::*; #[test] fn test_debug_impl() { macro_rules! assert_debug_impl { ($t:ty) => {{ trait NeedsDebug: std::fmt::Debug {} impl NeedsDebug for $t {} }}; } assert_debug_impl!(event::AccessKind); assert_debug_impl!(event::AccessMode); assert_debug_impl!(event::CreateKind); assert_debug_impl!(event::DataChange); assert_debug_impl!(event::EventAttributes); assert_debug_impl!(event::Flag); assert_debug_impl!(event::MetadataKind); assert_debug_impl!(event::ModifyKind); assert_debug_impl!(event::RemoveKind); assert_debug_impl!(event::RenameMode); assert_debug_impl!(event::Event); assert_debug_impl!(event::EventKind); assert_debug_impl!(debouncer_mini::DebouncedEvent); assert_debug_impl!(debouncer_mini::DebouncedEventKind); assert_debug_impl!(debouncer_full::DebouncedEvent); } } notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-any.snap000064400000000000000000000001521046102023000257110ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-close-any.snap000064400000000000000000000001711046102023000270150ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"close","mode":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-close-execute.snap000064400000000000000000000001751046102023000276740ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"close","mode":"execute","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-close-other.snap000064400000000000000000000001731046102023000273510ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"close","mode":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-close-read.snap000064400000000000000000000001721046102023000271420ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"close","mode":"read","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-close-write.snap000064400000000000000000000001731046102023000273620ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"close","mode":"write","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-open-any.snap000064400000000000000000000001701046102023000266500ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"open","mode":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-open-execute.snap000064400000000000000000000001741046102023000275270ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"open","mode":"execute","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-open-other.snap000064400000000000000000000001721046102023000272040ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"open","mode":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-open-read.snap000064400000000000000000000001711046102023000267750ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"open","mode":"read","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-open-write.snap000064400000000000000000000001721046102023000272150ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"open","mode":"write","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-other.snap000064400000000000000000000001541046102023000262450ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__access-read.snap000064400000000000000000000001531046102023000260360ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"access","kind":"read","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__any.snap000064400000000000000000000001321046102023000244500ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__create-any.snap000064400000000000000000000001521046102023000257130ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"create","kind":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__create-file.snap000064400000000000000000000001531046102023000260440ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"create","kind":"file","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__create-folder.snap000064400000000000000000000001551046102023000264020ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"create","kind":"folder","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__create-other.snap000064400000000000000000000001541046102023000262470ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"create","kind":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-any.snap000064400000000000000000000001521046102023000257370ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-data-any.snap000064400000000000000000000001701046102023000266460ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"data","mode":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-data-content.snap000064400000000000000000000001741046102023000275350ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"data","mode":"content","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-data-other.snap000064400000000000000000000001721046102023000272020ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"data","mode":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-data-size.snap000064400000000000000000000001711046102023000270320ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"data","mode":"size","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-accesstime.snap000064400000000000000000000002041046102023000310440ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"access-time","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-any.snap000064400000000000000000000001741046102023000275210ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-extended.snap000064400000000000000000000002011046102023000305210ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"extended","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-other.snap000064400000000000000000000001761046102023000300550ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-ownership.snap000064400000000000000000000002021046102023000307400ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"ownership","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-permissions.snap000064400000000000000000000002041046102023000312770ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"permissions","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-metadata-writetime.snap000064400000000000000000000002031046102023000307340ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"metadata","mode":"write-time","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-name-any.snap000064400000000000000000000001721046102023000266570ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"rename","mode":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-name-both.snap000064400000000000000000000001731046102023000270250ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"rename","mode":"both","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-name-from.snap000064400000000000000000000001731046102023000270340ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"rename","mode":"from","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-name-other.snap000064400000000000000000000001741046102023000272130ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"rename","mode":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-name-to.snap000064400000000000000000000001711046102023000265110ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"rename","mode":"to","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__modify-other.snap000064400000000000000000000001541046102023000262730ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"modify","kind":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__other.snap000064400000000000000000000001341046102023000250040ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__remove-any.snap000064400000000000000000000001521046102023000257450ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"remove","kind":"any","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__remove-file.snap000064400000000000000000000001531046102023000260760ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"remove","kind":"file","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__remove-folder.snap000064400000000000000000000001551046102023000264340ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"remove","kind":"folder","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__remove-other.snap000064400000000000000000000001541046102023000263010ustar 00000000000000--- source: notify/src/event.rs expression: json --- {"type":"remove","kind":"other","paths":[],"attrs":{}} notify-types-2.0.0/src/snapshots/notify_types__event__tests__serialize_event_with_attrs.snap000064400000000000000000000002371046102023000313270ustar 00000000000000--- source: notify/src/event.rs assertion_line: 694 expression: json --- {"type":"any","paths":[],"attrs":{"tracker":123,"flag":"rescan","info":"test event"}}