| 1 | //! The `Event` type and the hierarchical `EventKind` descriptor. |
| 2 | |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 4 | fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/, |
| 5 | hashrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/::{Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#, Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#}, |
| 6 | pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#, |
| 7 | }; |
| 8 | |
| 9 | use bitflagsrust-analyzer cargo bitflags 2.10.0 crate/::bitflagsrust-analyzer cargo bitflags 2.10.0 bitflags!; |
| 10 | |
| 11 | #[cfg(feature = "serde")] |
| 12 | use serderust-analyzer cargo serde 1.0.228 crate/::{Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#, Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize#}; |
| 13 | |
| 14 | /// An event describing open or close operations on files. |
| 15 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 16 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 17 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 18 | pub enum AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode# { |
| 19 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 20 | Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#, |
| 21 | |
| 22 | /// An event emitted when the file is executed, or the folder opened. |
| 23 | Executerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Execute#, |
| 24 | |
| 25 | /// An event emitted when the file is opened for reading. |
| 26 | Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#, |
| 27 | |
| 28 | /// An event emitted when the file is opened for writing. |
| 29 | Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#, |
| 30 | |
| 31 | /// An event which specific kind is known but cannot be represented otherwise. |
| 32 | Otherrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Other#, |
| 33 | } |
| 34 | |
| 35 | /// An event describing non-mutating access operations on files. |
| 36 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 37 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 38 | #[cfg_attr(feature = "serde", serde(tag = "kind", content = "mode"))] |
| 39 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 40 | pub enum AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind# { |
| 41 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 42 | Anyrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Any#, |
| 43 | |
| 44 | /// An event emitted when the file is read. |
| 45 | Readrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Read#, |
| 46 | |
| 47 | /// An event emitted when the file, or a handle to the file, is opened. |
| 48 | Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#), |
| 49 | |
| 50 | /// An event emitted when the file, or a handle to the file, is closed. |
| 51 | Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#), |
| 52 | |
| 53 | /// An event which specific kind is known but cannot be represented otherwise. |
| 54 | Otherrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Other#, |
| 55 | } |
| 56 | |
| 57 | /// An event describing creation operations on files. |
| 58 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 59 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 60 | #[cfg_attr(feature = "serde", serde(tag = "kind"))] |
| 61 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 62 | pub enum CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind# { |
| 63 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 64 | Anyrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Any#, |
| 65 | |
| 66 | /// An event which results in the creation of a file. |
| 67 | Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#, |
| 68 | |
| 69 | /// An event which results in the creation of a folder. |
| 70 | Folderrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Folder#, |
| 71 | |
| 72 | /// An event which specific kind is known but cannot be represented otherwise. |
| 73 | Otherrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Other#, |
| 74 | } |
| 75 | |
| 76 | /// An event emitted when the data content of a file is changed. |
| 77 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 78 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 79 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 80 | pub enum DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange# { |
| 81 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 82 | Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#, |
| 83 | |
| 84 | /// An event emitted when the size of the data is changed. |
| 85 | Sizerust-analyzer cargo notify-types 2.1.0 event/DataChange#Size#, |
| 86 | |
| 87 | /// An event emitted when the content of the data is changed. |
| 88 | Contentrust-analyzer cargo notify-types 2.1.0 event/DataChange#Content#, |
| 89 | |
| 90 | /// An event which specific kind is known but cannot be represented otherwise. |
| 91 | Otherrust-analyzer cargo notify-types 2.1.0 event/DataChange#Other#, |
| 92 | } |
| 93 | |
| 94 | /// An event emitted when the metadata of a file or folder is changed. |
| 95 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 96 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 97 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 98 | pub enum MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind# { |
| 99 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 100 | Anyrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Any#, |
| 101 | |
| 102 | /// An event emitted when the access time of the file or folder is changed. |
| 103 | AccessTimerust-analyzer cargo notify-types 2.1.0 event/MetadataKind#AccessTime#, |
| 104 | |
| 105 | /// An event emitted when the write or modify time of the file or folder is changed. |
| 106 | WriteTimerust-analyzer cargo notify-types 2.1.0 event/MetadataKind#WriteTime#, |
| 107 | |
| 108 | /// An event emitted when the permissions of the file or folder are changed. |
| 109 | Permissionsrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Permissions#, |
| 110 | |
| 111 | /// An event emitted when the ownership of the file or folder is changed. |
| 112 | Ownershiprust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Ownership#, |
| 113 | |
| 114 | /// An event emitted when an extended attribute of the file or folder is changed. |
| 115 | /// |
| 116 | /// If the extended attribute's name or type is known, it should be provided in the |
| 117 | /// `Info` event attribute. |
| 118 | Extendedrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Extended#, |
| 119 | |
| 120 | /// An event which specific kind is known but cannot be represented otherwise. |
| 121 | Otherrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Other#, |
| 122 | } |
| 123 | |
| 124 | /// An event emitted when the name of a file or folder is changed. |
| 125 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 126 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 127 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 128 | pub enum RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode# { |
| 129 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 130 | Anyrust-analyzer cargo notify-types 2.1.0 event/RenameMode#Any#, |
| 131 | |
| 132 | /// An event emitted on the file or folder resulting from a rename. |
| 133 | Torust-analyzer cargo notify-types 2.1.0 event/RenameMode#To#, |
| 134 | |
| 135 | /// An event emitted on the file or folder that was renamed. |
| 136 | Fromrust-analyzer cargo notify-types 2.1.0 event/RenameMode#From#, |
| 137 | |
| 138 | /// A single event emitted with both the `From` and `To` paths. |
| 139 | /// |
| 140 | /// This event should be emitted when both source and target are known. The paths should be |
| 141 | /// provided in this exact order (from, to). |
| 142 | Bothrust-analyzer cargo notify-types 2.1.0 event/RenameMode#Both#, |
| 143 | |
| 144 | /// An event which specific kind is known but cannot be represented otherwise. |
| 145 | Otherrust-analyzer cargo notify-types 2.1.0 event/RenameMode#Other#, |
| 146 | } |
| 147 | |
| 148 | /// An event describing mutation of content, name, or metadata. |
| 149 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 150 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 151 | #[cfg_attr(feature = "serde", serde(tag = "kind", content = "mode"))] |
| 152 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 153 | pub enum ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind# { |
| 154 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 155 | Anyrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Any#, |
| 156 | |
| 157 | /// An event emitted when the data content of a file is changed. |
| 158 | Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#), |
| 159 | |
| 160 | /// An event emitted when the metadata of a file or folder is changed. |
| 161 | Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#), |
| 162 | |
| 163 | /// An event emitted when the name of a file or folder is changed. |
| 164 | #[cfg_attr(feature = "serde", serde(rename = "rename"))] |
| 165 | Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#), |
| 166 | |
| 167 | /// An event which specific kind is known but cannot be represented otherwise. |
| 168 | Otherrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Other#, |
| 169 | } |
| 170 | |
| 171 | /// An event describing removal operations on files. |
| 172 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 173 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 174 | #[cfg_attr(feature = "serde", serde(tag = "kind"))] |
| 175 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 176 | pub enum RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind# { |
| 177 | /// The catch-all case, to be used when the specific kind of event is unknown. |
| 178 | Anyrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Any#, |
| 179 | |
| 180 | /// An event emitted when a file is removed. |
| 181 | Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#, |
| 182 | |
| 183 | /// An event emitted when a folder is removed. |
| 184 | Folderrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Folder#, |
| 185 | |
| 186 | /// An event which specific kind is known but cannot be represented otherwise. |
| 187 | Otherrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Other#, |
| 188 | } |
| 189 | |
| 190 | /// Top-level event kind. |
| 191 | /// |
| 192 | /// This is arguably the most important classification for events. All subkinds below this one |
| 193 | /// represent details that may or may not be available for any particular backend, but most tools |
| 194 | /// and Notify systems will only care about which of these four general kinds an event is about. |
| 195 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 196 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 197 | #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] |
| 198 | #[cfg_attr( |
| 199 | all(feature = "serde", not(feature = "serialization-compat-6")), |
| 200 | serde(tag = "type") |
| 201 | )] |
| 202 | pub enum EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind# { |
| 203 | /// The catch-all event kind, for unsupported/unknown events. |
| 204 | /// |
| 205 | /// This variant should be used as the "else" case when mapping native kernel bitmasks or |
| 206 | /// bitmaps, such that if the mask is ever extended with new event types the backend will not |
| 207 | /// gain bugs due to not matching new unknown event types. |
| 208 | /// |
| 209 | /// This variant is also the default variant used when Notify is in "imprecise" mode. |
| 210 | #[defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/default:] |
| 211 | Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any#, |
| 212 | |
| 213 | /// An event describing non-mutating access operations on files. |
| 214 | /// |
| 215 | /// This event is about opening and closing file handles, as well as executing files, and any |
| 216 | /// other such event that is about accessing files, folders, or other structures rather than |
| 217 | /// mutating them. |
| 218 | /// |
| 219 | /// Only some platforms are capable of generating these. |
| 220 | Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#), |
| 221 | |
| 222 | /// An event describing creation operations on files. |
| 223 | /// |
| 224 | /// This event is about the creation of files, folders, or other structures but not about e.g. |
| 225 | /// writing new content into them. |
| 226 | Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#), |
| 227 | |
| 228 | /// An event describing mutation of content, name, or metadata. |
| 229 | /// |
| 230 | /// This event is about the mutation of files', folders', or other structures' content, name |
| 231 | /// (path), or associated metadata (attributes). |
| 232 | Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#), |
| 233 | |
| 234 | /// An event describing removal operations on files. |
| 235 | /// |
| 236 | /// This event is about the removal of files, folders, or other structures but not e.g. erasing |
| 237 | /// content from them. This may also be triggered for renames/moves that move files _out of the |
| 238 | /// watched subpath_. |
| 239 | /// |
| 240 | /// Some editors also trigger Remove events when saving files as they may opt for removing (or |
| 241 | /// renaming) the original then creating a new file in-place. |
| 242 | Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#), |
| 243 | |
| 244 | /// An event not fitting in any of the above four categories. |
| 245 | /// |
| 246 | /// This may be used for meta-events about the watch itself. |
| 247 | Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other#, |
| 248 | } |
| 249 | |
| 250 | impl EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind# { |
| 251 | /// Indicates whether an event is an Access variant. |
| 252 | pub fn is_accessrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind]is_access().(&self) -> bool { |
| 253 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(_)) |
| 254 | } |
| 255 | |
| 256 | /// Indicates whether an event is a Create variant. |
| 257 | pub fn is_createrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind]is_create().(&self) -> bool { |
| 258 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(_)) |
| 259 | } |
| 260 | |
| 261 | /// Indicates whether an event is a Modify variant. |
| 262 | pub fn is_modifyrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind]is_modify().(&self) -> bool { |
| 263 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(_)) |
| 264 | } |
| 265 | |
| 266 | /// Indicates whether an event is a Remove variant. |
| 267 | pub fn is_removerust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind]is_remove().(&self) -> bool { |
| 268 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(_)) |
| 269 | } |
| 270 | |
| 271 | /// Indicates whether an event is an Other variant. |
| 272 | pub fn is_otherrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind]is_other().(&self) -> bool { |
| 273 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other#) |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | bitflagsrust-analyzer cargo bitflags 2.10.0 bitflags!! { |
| 278 | /// A bitmask specifying which event kinds to monitor. |
| 279 | /// |
| 280 | /// This type allows fine-grained control over which filesystem events are reported. |
| 281 | /// On backends that support kernel-level filtering (inotify), the mask is |
| 282 | /// translated to native flags for optimal performance. On other backends (kqueue, |
| 283 | /// Windows, FSEvents, PollWatcher), filtering is applied in userspace. |
| 284 | /// |
| 285 | /// # Examples |
| 286 | /// |
| 287 | /// ``` |
| 288 | /// use notify_types::event::EventKindMask; |
| 289 | /// |
| 290 | /// // Monitor only file creations and deletions |
| 291 | /// let mask = EventKindMask::CREATE | EventKindMask::REMOVE; |
| 292 | /// |
| 293 | /// // Monitor everything including access events |
| 294 | /// let all = EventKindMask::ALL; |
| 295 | /// |
| 296 | /// // Default: includes all events (matches Config::default()) |
| 297 | /// let default = EventKindMask::default(); |
| 298 | /// assert_eq!(default, EventKindMask::ALL); |
| 299 | /// ``` |
| 300 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 301 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 302 | pub struct EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#: u32 { |
| 303 | /// Monitor file/folder creation events. |
| 304 | const CREATErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CREATE. = 0b0000_0001; |
| 305 | |
| 306 | /// Monitor file/folder removal events. |
| 307 | const REMOVErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]REMOVE. = 0b0000_0010; |
| 308 | |
| 309 | /// Monitor data modification events (content/size changes). |
| 310 | const MODIFY_DATArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_DATA. = 0b0000_0100; |
| 311 | |
| 312 | /// Monitor metadata modification events (permissions, timestamps, etc). |
| 313 | const MODIFY_METArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_META. = 0b0000_1000; |
| 314 | |
| 315 | /// Monitor name/rename events. |
| 316 | const MODIFY_NAMErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_NAME. = 0b0001_0000; |
| 317 | |
| 318 | /// Monitor file open events. |
| 319 | const ACCESS_OPENrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_OPEN. = 0b0010_0000; |
| 320 | |
| 321 | /// Monitor file close events after writing. |
| 322 | /// This fires when a file opened for writing is closed. |
| 323 | const ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE. = 0b0100_0000; |
| 324 | |
| 325 | /// Monitor file close events after read-only access. |
| 326 | /// This fires when a file opened for reading (not writing) is closed. |
| 327 | /// Note: This can be very noisy and may cause queue overflow on busy systems. |
| 328 | const ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE. = 0b1000_0000; |
| 329 | |
| 330 | /// All modify events (data, metadata, and name changes). |
| 331 | const ALL_MODIFYrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_MODIFY. = Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::MODIFY_DATArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_DATA..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::MODIFY_METArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_META..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::MODIFY_NAMErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_NAME..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().(); |
| 332 | |
| 333 | /// All access events (open, close-write, and close-nowrite). |
| 334 | const ALL_ACCESSrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_ACCESS. = Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::ACCESS_OPENrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_OPEN..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().(); |
| 335 | |
| 336 | /// Core events: create, remove, and all modify events. |
| 337 | /// This is the default and matches the current notify behavior (no access events). |
| 338 | const CORErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CORE. = Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::CREATErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CREATE..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::REMOVErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]REMOVE..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::ALL_MODIFYrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_MODIFY..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().(); |
| 339 | |
| 340 | /// All events including access events. |
| 341 | const ALLrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL. = Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::CORErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CORE..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().() |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]::ALL_ACCESSrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_ACCESS..bitsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]bits().(); |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask# { |
| 346 | fn defaultrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][Default]default().() -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][Default] { |
| 347 | EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALLrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL. |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | impl EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask# { |
| 352 | /// Returns whether the given event kind matches this mask. |
| 353 | /// |
| 354 | /// `EventKind::Any` and `EventKind::Other` always pass regardless of the mask, |
| 355 | /// as they represent meta-events that should not be filtered. |
| 356 | /// |
| 357 | /// # Examples |
| 358 | /// |
| 359 | /// ``` |
| 360 | /// use notify_types::event::{EventKindMask, EventKind, CreateKind, AccessKind, AccessMode}; |
| 361 | /// |
| 362 | /// let mask = EventKindMask::CREATE; |
| 363 | /// assert!(mask.matches(&EventKind::Create(CreateKind::File))); |
| 364 | /// assert!(!mask.matches(&EventKind::Access(AccessKind::Open(AccessMode::Read)))); |
| 365 | /// |
| 366 | /// // Any and Other always pass |
| 367 | /// let empty = EventKindMask::empty(); |
| 368 | /// assert!(empty.matches(&EventKind::Any)); |
| 369 | /// assert!(empty.matches(&EventKind::Other)); |
| 370 | /// ``` |
| 371 | pub fn matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&self, kind: &EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#) -> bool { |
| 372 | match kind { |
| 373 | // Meta-events always pass |
| 374 | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any# | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other# => true, |
| 375 | |
| 376 | // Create events |
| 377 | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::CREATErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CREATE.), |
| 378 | |
| 379 | // Remove events |
| 380 | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::REMOVErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]REMOVE.), |
| 381 | |
| 382 | // Modify events - check subkind |
| 383 | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(modify_kind) => match modify_kind { |
| 384 | ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_DATArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_DATA.), |
| 385 | ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_METArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_META.), |
| 386 | ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_NAMErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_NAME.), |
| 387 | // ModifyKind::Any and ModifyKind::Other pass if any modify flag is set |
| 388 | ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Any# | ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Other# => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALL_MODIFYrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_MODIFY.), |
| 389 | }, |
| 390 | |
| 391 | // Access events - check subkind |
| 392 | EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(access_kind) => match access_kind { |
| 393 | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(_) => self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_OPENrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_OPEN.), |
| 394 | // Close after write |
| 395 | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#) => { |
| 396 | self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE.) |
| 397 | } |
| 398 | // Close after read-only (no write) |
| 399 | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#) => { |
| 400 | self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE.) |
| 401 | } |
| 402 | // Close with unknown mode - match if either close flag is set |
| 403 | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(_) => self |
| 404 | .intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE. rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().|rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor(). rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE.), |
| 405 | // AccessKind::Read, Any, and Other pass if any access flag is set |
| 406 | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Read# | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Any# | AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Other# => { |
| 407 | self.intersectsrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]intersects().(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALL_ACCESSrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_ACCESS.) |
| 408 | } |
| 409 | }, |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | /// Notify event. |
| 415 | /// |
| 416 | /// You might want to check [`Event::need_rescan`] to make sure no event was missed before you |
| 417 | /// received this one. |
| 418 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 419 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 420 | pub struct Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 421 | /// Kind or type of the event. |
| 422 | /// |
| 423 | /// This is a hierarchy of enums describing the event as precisely as possible. All enums in |
| 424 | /// the hierarchy have two variants always present, `Any` and `Other`, accompanied by one or |
| 425 | /// more specific variants. |
| 426 | /// |
| 427 | /// `Any` should be used when more detail about the event is not known beyond the variant |
| 428 | /// already selected. For example, `AccessMode::Any` means a file has been accessed, but that's |
| 429 | /// all we know. |
| 430 | /// |
| 431 | /// `Other` should be used when more detail _is_ available, but cannot be encoded as one of the |
| 432 | /// defined variants. When specifying `Other`, the event attributes should contain an `Info` |
| 433 | /// entry with a short string identifying this detail. That string is to be considered part of |
| 434 | /// the interface of the backend (i.e. a change should probably be breaking). |
| 435 | /// |
| 436 | /// For example, `CreateKind::Other` with an `Info("mount")` may indicate the binding of a |
| 437 | /// mount. The documentation of the particular backend should indicate if any `Other` events |
| 438 | /// are generated, and what their description means. |
| 439 | /// |
| 440 | /// The `EventKind::Any` variant should be used as the "else" case when mapping native kernel |
| 441 | /// bitmasks or bitmaps, such that if the mask is ever extended with new event types the |
| 442 | /// backend will not gain bugs due to not matching new unknown event types. |
| 443 | #[cfg_attr( |
| 444 | all(feature = "serde", not(feature = "serialization-compat-6")), |
| 445 | serde(flatten) |
| 446 | )] |
| 447 | #[cfg_attr( |
| 448 | all(feature = "serde", feature = "serialization-compat-6"), |
| 449 | serde(rename = "type") |
| 450 | )] |
| 451 | pub kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind.: EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#, |
| 452 | |
| 453 | /// Paths the event is about, if known. |
| 454 | /// |
| 455 | /// If an event concerns two or more paths, and the paths are known at the time of event |
| 456 | /// creation, they should all go in this `Vec`. Otherwise, using the `Tracker` attr may be more |
| 457 | /// appropriate. |
| 458 | /// |
| 459 | /// The order of the paths is likely to be significant! For example, renames where both ends of |
| 460 | /// the name change are known will have the "source" path first, and the "target" path last. |
| 461 | pub pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#>, |
| 462 | |
| 463 | // "What should be in the struct" and "what can go in the attrs" is an interesting question. |
| 464 | // |
| 465 | // Technically, the paths could go in the attrs. That would reduce the type size to 4 pointer |
| 466 | // widths, instead of 7 like it is now. Anything 8 and below is probably good — on x64 that's |
| 467 | // the size of an L1 cache line. The entire kind classification fits in 3 bytes, and an AnyMap |
| 468 | // is 3 pointers. A Vec<PathBuf> is another 3 pointers. |
| 469 | // |
| 470 | // Type size aside, what's behind these structures? A Vec and a PathBuf is stored on the heap. |
| 471 | // An AnyMap is stored on the heap. But a Vec is directly there, requiring about one access to |
| 472 | // get, while retrieving anything in the AnyMap requires some accesses as overhead. |
| 473 | // |
| 474 | // So things that are used often should be on the struct, and things that are used more rarely |
| 475 | // should go in the attrs. Additionally, arbitrary data can _only_ go in the attrs. |
| 476 | // |
| 477 | // The kind and the paths vie for first place on this scale, depending on how downstream wishes |
| 478 | // to use the information. Everything else is secondary. So far, that's why paths live here. |
| 479 | // |
| 480 | // In the future, it might be possible to have more data and to benchmark things properly, so |
| 481 | // the performance can be actually quantified. Also, it might turn out that I have no idea what |
| 482 | // I was talking about, so the above may be discarded or reviewed. We'll see! |
| 483 | // |
| 484 | /// Additional attributes of the event. |
| 485 | /// |
| 486 | /// Arbitrary data may be added to this field, without restriction beyond the `Sync` and |
| 487 | /// `Clone` properties. Some data added here is considered for comparing and hashing, but not |
| 488 | /// all: at this writing this is `Tracker`, `Flag`, `Info`, and `Source`. |
| 489 | #[cfg_attr(feature = "serde", serde(default))] |
| 490 | pub attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs.: EventAttributesrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#, |
| 491 | } |
| 492 | |
| 493 | /// Additional attributes of the event. |
| 494 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 495 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 496 | pub struct EventAttributesrust-analyzer cargo notify-types 2.1.0 event/EventAttributes# { |
| 497 | #[cfg_attr(feature = "serde", serde(flatten))] |
| 498 | innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<EventAttributesInnerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#>>, |
| 499 | } |
| 500 | |
| 501 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 502 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:))] |
| 503 | struct EventAttributesInnerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner# { |
| 504 | /// Tracking ID for events that are related. |
| 505 | /// |
| 506 | /// For events generated by backends with the `TrackRelated` capability. Those backends _may_ |
| 507 | /// emit events that are related to each other, and tag those with an identical "tracking id" |
| 508 | /// or "cookie". The value is normalised to `usize`. |
| 509 | #[cfg_attr( |
| 510 | feature = "serde", |
| 511 | serde(default, skip_serializing_if = "Option::is_none") |
| 512 | )] |
| 513 | trackerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#tracker.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>, |
| 514 | |
| 515 | /// Special Notify flag on the event. |
| 516 | #[cfg_attr( |
| 517 | feature = "serde", |
| 518 | serde(default, skip_serializing_if = "Option::is_none") |
| 519 | )] |
| 520 | flagrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#flag.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#>, |
| 521 | |
| 522 | /// Additional information on the event. |
| 523 | /// |
| 524 | /// This is to be used for all `Other` variants of the event kind hierarchy. The variant |
| 525 | /// indicates that a consumer should look into the `attrs` for an `Info` value; if that value |
| 526 | /// is missing it should be considered a backend bug. |
| 527 | /// |
| 528 | /// This attribute may also be present for non-`Other` variants of the event kind, if doing so |
| 529 | /// provides useful precision. For example, the `Modify(Metadata(Extended))` kind suggests |
| 530 | /// using this attribute when information about _what_ extended metadata changed is available. |
| 531 | /// |
| 532 | /// This should be a short string, and changes may be considered breaking. |
| 533 | #[cfg_attr( |
| 534 | feature = "serde", |
| 535 | serde(default, skip_serializing_if = "Option::is_none") |
| 536 | )] |
| 537 | inforust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#info.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 538 | |
| 539 | /// The source of the event. |
| 540 | /// |
| 541 | /// In most cases this should be a short string, identifying the backend unambiguously. In some |
| 542 | /// cases this may be dynamically generated, but should contain a prefix to make it unambiguous |
| 543 | /// between backends. |
| 544 | #[cfg_attr( |
| 545 | feature = "serde", |
| 546 | serde(default, skip_serializing_if = "Option::is_none") |
| 547 | )] |
| 548 | sourcerust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#source.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 549 | |
| 550 | /// The process ID of the originator of the event. |
| 551 | /// |
| 552 | /// This attribute is experimental and, while included in Notify itself, is not considered |
| 553 | /// stable or standard enough to be part of the serde, eq, hash, and debug representations. |
| 554 | #[cfg_attr( |
| 555 | feature = "serde", |
| 556 | serde(default, skip_serializing, skip_deserializing) |
| 557 | )] |
| 558 | process_idrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#process_id.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>, |
| 559 | } |
| 560 | |
| 561 | impl EventAttributesrust-analyzer cargo notify-types 2.1.0 event/EventAttributes# { |
| 562 | /// Creates a new `EventAttributes`. |
| 563 | pub fn newrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]new().() -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes] { |
| 564 | Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes] { innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# } |
| 565 | } |
| 566 | |
| 567 | /// Retrieves the tracker ID for an event directly, if present. |
| 568 | pub fn trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]tracker().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize> { |
| 569 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().().and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(|inner| inner.trackerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#tracker.) |
| 570 | } |
| 571 | |
| 572 | /// Retrieves the Notify flag for an event directly, if present. |
| 573 | pub fn flagrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]flag().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#> { |
| 574 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().().and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(|inner| inner.flagrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#flag.) |
| 575 | } |
| 576 | |
| 577 | /// Retrieves the additional info for an event directly, if present. |
| 578 | pub fn inforust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]info().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 579 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().().and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(|inner| inner.inforust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#info..as_derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_deref().()) |
| 580 | } |
| 581 | |
| 582 | /// Retrieves the source for an event directly, if present. |
| 583 | pub fn sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]source().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 584 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner. |
| 585 | .as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().() |
| 586 | .and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(|inner| inner.sourcerust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#source..as_derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_deref().()) |
| 587 | } |
| 588 | |
| 589 | /// The process ID of the originator of the event. |
| 590 | /// |
| 591 | /// This attribute is experimental and, while included in Notify itself, is not considered |
| 592 | /// stable or standard enough to be part of the serde, eq, hash, and debug representations. |
| 593 | pub fn process_idrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]process_id().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32> { |
| 594 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().().and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(|inner| inner.process_idrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#process_id.) |
| 595 | } |
| 596 | |
| 597 | /// Sets the tracker. |
| 598 | pub fn set_trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_tracker().(&mut self, tracker: usize) { |
| 599 | self.inner_mutrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]inner_mut().().trackerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#tracker. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(tracker); |
| 600 | } |
| 601 | |
| 602 | /// Sets the Notify flag onto the event. |
| 603 | pub fn set_flagrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_flag().(&mut self, flag: Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#) { |
| 604 | self.inner_mutrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]inner_mut().().flagrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#flag. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(flag); |
| 605 | } |
| 606 | |
| 607 | /// Sets additional info onto the event. |
| 608 | pub fn set_inforust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_info().(&mut self, info: &str) { |
| 609 | self.inner_mutrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]inner_mut().().inforust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#info. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(info.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 610 | } |
| 611 | |
| 612 | /// Sets the process id onto the event. |
| 613 | pub fn set_process_idrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_process_id().(&mut self, process_id: u32) { |
| 614 | self.inner_mutrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]inner_mut().().process_idrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner#process_id. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(process_id) |
| 615 | } |
| 616 | |
| 617 | fn inner_mutrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]inner_mut().(&mut self) -> &mut EventAttributesInnerrust-analyzer cargo notify-types 2.1.0 event/EventAttributesInner# { |
| 618 | self.innerrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#inner..get_or_insert_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]get_or_insert_with().(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::defaultrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`][Default]default().) |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | /// Special Notify flag on the event. |
| 623 | /// |
| 624 | /// This attribute is used to flag certain kinds of events that Notify either marks or generates in |
| 625 | /// particular ways. |
| 626 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 627 | #[cfg_attr(feature = "serde", derive(Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:))] |
| 628 | #[cfg_attr( |
| 629 | all(feature = "serde", not(feature = "serialization-compat-6")), |
| 630 | serde(rename_all = "camelCase") |
| 631 | )] |
| 632 | pub enum Flagrust-analyzer cargo notify-types 2.1.0 event/Flag# { |
| 633 | /// Rescan notices are emitted by some platforms (and may also be emitted by Notify itself). |
| 634 | /// They indicate either a lapse in the events or a change in the filesystem such that events |
| 635 | /// received so far can no longer be relied on to represent the state of the filesystem now. |
| 636 | /// |
| 637 | /// An application that simply reacts to file changes may not care about this. An application |
| 638 | /// that keeps an in-memory representation of the filesystem will need to care, and will need |
| 639 | /// to refresh that representation directly from the filesystem. |
| 640 | Rescanrust-analyzer cargo notify-types 2.1.0 event/Flag#Rescan#, |
| 641 | } |
| 642 | |
| 643 | impl Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 644 | /// Returns whether some events may have been missed. If true, you should assume any file or |
| 645 | /// folder might have been modified. |
| 646 | /// |
| 647 | /// See [`Flag::Rescan`] for more information. |
| 648 | pub fn need_rescanrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]need_rescan().(&self) -> bool { |
| 649 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self.flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#::Rescanrust-analyzer cargo notify-types 2.1.0 event/Flag#Rescan#)) |
| 650 | } |
| 651 | /// Retrieves the tracker ID for an event directly, if present. |
| 652 | pub fn trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]tracker().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize> { |
| 653 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]tracker().() |
| 654 | } |
| 655 | |
| 656 | /// Retrieves the Notify flag for an event directly, if present. |
| 657 | pub fn flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#> { |
| 658 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..flagrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]flag().() |
| 659 | } |
| 660 | |
| 661 | /// Retrieves the additional info for an event directly, if present. |
| 662 | pub fn inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]info().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 663 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..inforust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]info().() |
| 664 | } |
| 665 | |
| 666 | /// Retrieves the source for an event directly, if present. |
| 667 | pub fn sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[Event]source().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 668 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]source().() |
| 669 | } |
| 670 | |
| 671 | /// Creates a new `Event` given a kind. |
| 672 | pub fn newrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]new().(kind: EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 673 | Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 674 | kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind., |
| 675 | pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), |
| 676 | attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs.: EventAttributesrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#::newrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]new().(), |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | /// Sets the kind. |
| 681 | pub fn set_kindrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]set_kind().(mut self, kind: EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 682 | self.kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind. = kind; |
| 683 | self |
| 684 | } |
| 685 | |
| 686 | /// Adds a path to the event. |
| 687 | pub fn add_pathrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]add_path().(mut self, path: PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 688 | self.pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(path); |
| 689 | self |
| 690 | } |
| 691 | |
| 692 | /// Adds a path to the event if the argument is Some. |
| 693 | pub fn add_some_pathrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]add_some_path().(self, path: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#>) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 694 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(path) = path { |
| 695 | self.add_pathrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]add_path().(path) |
| 696 | } else { |
| 697 | self |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | /// Sets the tracker. |
| 702 | pub fn set_trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]set_tracker().(mut self, tracker: usize) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 703 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..set_trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_tracker().(tracker); |
| 704 | self |
| 705 | } |
| 706 | |
| 707 | /// Sets additional info onto the event. |
| 708 | pub fn set_inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]set_info().(mut self, info: &str) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 709 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..set_inforust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_info().(info); |
| 710 | self |
| 711 | } |
| 712 | |
| 713 | /// Sets the Notify flag onto the event. |
| 714 | pub fn set_flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]set_flag().(mut self, flag: Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 715 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..set_flagrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_flag().(flag); |
| 716 | self |
| 717 | } |
| 718 | |
| 719 | /// Sets the process id onto the event. |
| 720 | pub fn set_process_idrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]set_process_id().(mut self, process_id: u32) -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event] { |
| 721 | self.attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs..set_process_idrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]set_process_id().(process_id); |
| 722 | self |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 727 | fn fmtrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][Debug]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 728 | f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Event") |
| 729 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("kind", &self.kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind.) |
| 730 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("paths", &self.pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths.) |
| 731 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("attr:tracker", &self.trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]tracker().()) |
| 732 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("attr:flag", &self.flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().()) |
| 733 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("attr:info", &self.inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]info().()) |
| 734 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("attr:source", &self.sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[Event]source().()) |
| 735 | .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().() |
| 736 | } |
| 737 | } |
| 738 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 739 | fn defaultrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][Default]default().() -> Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][Default] { |
| 740 | Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][Default] { |
| 741 | kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind.: EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::defaultrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind][Default]default().(), |
| 742 | pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), |
| 743 | attrsrust-analyzer cargo notify-types 2.1.0 event/Event#attrs.: EventAttributesrust-analyzer cargo notify-types 2.1.0 event/EventAttributes#::newrust-analyzer cargo notify-types 2.1.0 event/impl#[EventAttributes]new().(), |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | impl Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq# for Eventrust-analyzer cargo notify-types 2.1.0 event/Event# {} |
| 749 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 750 | fn eqrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][`PartialEq<Self>`]eq().(&self, other: &Selfrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][`PartialEq<Self>`]) -> bool { |
| 751 | self.kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind..eqrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind][`PartialEq<Self>`]eq().(&other.kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind.) |
| 752 | && self.pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths..eqrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/partial_eq/impl#[`Vec<T, A1>`][`PartialEq<Vec<U, A2>>`]eq().(&other.pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths.) |
| 753 | && self.trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]tracker().().eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().(&other.trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]tracker().()) |
| 754 | && self.flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().().eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().(&other.flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().()) |
| 755 | && self.inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]info().().eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().(&other.inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]info().()) |
| 756 | && self.sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[Event]source().().eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().(&other.sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[Event]source().()) |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | impl Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash# for Eventrust-analyzer cargo notify-types 2.1.0 event/Event# { |
| 761 | fn hashrust-analyzer cargo notify-types 2.1.0 event/impl#[Event][Hash]hash().<H: Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#>(&self, state: &mut H) { |
| 762 | self.kindrust-analyzer cargo notify-types 2.1.0 event/Event#kind..hashrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKind][Hash]hash().(state); |
| 763 | self.pathsrust-analyzer cargo notify-types 2.1.0 event/Event#paths..hashrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Hash]hash().(state); |
| 764 | self.trackerrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]tracker().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Hash]hash().(state); |
| 765 | self.flagrust-analyzer cargo notify-types 2.1.0 event/impl#[Event]flag().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Hash]hash().(state); |
| 766 | self.inforust-analyzer cargo notify-types 2.1.0 event/impl#[Event]info().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Hash]hash().(state); |
| 767 | self.sourcerust-analyzer cargo notify-types 2.1.0 event/impl#[Event]source().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Hash]hash().(state); |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | #[cfg(test)] |
| 772 | mod event_kind_mask_testsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/ { |
| 773 | use superrust-analyzer cargo notify-types 2.1.0 event/::*; |
| 774 | |
| 775 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 776 | fn default_is_allrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/default_is_all().() { |
| 777 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::defaultrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][Default]default().(), EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALLrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL.); |
| 778 | } |
| 779 | |
| 780 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 781 | fn matches_create_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_create_events().() { |
| 782 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::CREATErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CREATE.; |
| 783 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 784 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Folderrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Folder#))); |
| 785 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Any#))); |
| 786 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/CreateKind#Other#))); |
| 787 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#))); |
| 788 | } |
| 789 | |
| 790 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 791 | fn matches_remove_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_remove_events().() { |
| 792 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::REMOVErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]REMOVE.; |
| 793 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#))); |
| 794 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Folderrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Folder#))); |
| 795 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Any#))); |
| 796 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 797 | } |
| 798 | |
| 799 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 800 | fn matches_access_open_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_access_open_events().() { |
| 801 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_OPENrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_OPEN.; |
| 802 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 803 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#)))); |
| 804 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 805 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 806 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 807 | } |
| 808 | |
| 809 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 810 | fn matches_access_close_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_access_close_events().() { |
| 811 | // ACCESS_CLOSE only matches Close(Write), not Close(Read) |
| 812 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE.; |
| 813 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 814 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); // Any could be write |
| 815 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#)))); // Read goes to NOWRITE |
| 816 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 817 | } |
| 818 | |
| 819 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 820 | fn matches_access_close_nowrite_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_access_close_nowrite_events().() { |
| 821 | // ACCESS_CLOSE_NOWRITE matches Close(Read) - files opened read-only |
| 822 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE.; |
| 823 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#)))); |
| 824 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); // Any could be read |
| 825 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); // Write goes to ACCESS_CLOSE |
| 826 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 827 | } |
| 828 | |
| 829 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 830 | fn combined_close_masks_match_bothrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/combined_close_masks_match_both().() { |
| 831 | // When both ACCESS_CLOSE and ACCESS_CLOSE_NOWRITE are set, match both |
| 832 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE. rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().|rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor(). rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ACCESS_CLOSE_NOWRITErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ACCESS_CLOSE_NOWRITE.; |
| 833 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 834 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#)))); |
| 835 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 836 | } |
| 837 | |
| 838 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 839 | fn all_access_matches_open_close_read_any_otherrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/all_access_matches_open_close_read_any_other().() { |
| 840 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALL_ACCESSrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_ACCESS.; |
| 841 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Read#)))); |
| 842 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 843 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Read#))); |
| 844 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Any#))); |
| 845 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Other#))); |
| 846 | } |
| 847 | |
| 848 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 849 | fn matches_modify_data_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_modify_data_events().() { |
| 850 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_DATArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_DATA.; |
| 851 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 852 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Sizerust-analyzer cargo notify-types 2.1.0 event/DataChange#Size#)))); |
| 853 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Contentrust-analyzer cargo notify-types 2.1.0 event/DataChange#Content#)))); |
| 854 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Any#)))); |
| 855 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Fromrust-analyzer cargo notify-types 2.1.0 event/RenameMode#From#)))); |
| 856 | } |
| 857 | |
| 858 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 859 | fn matches_modify_metadata_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_modify_metadata_events().() { |
| 860 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_METArust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_META.; |
| 861 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Any#)))); |
| 862 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#( |
| 863 | MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#::Permissionsrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Permissions# |
| 864 | )))); |
| 865 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 866 | } |
| 867 | |
| 868 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 869 | fn matches_modify_name_eventsrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/matches_modify_name_events().() { |
| 870 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::MODIFY_NAMErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]MODIFY_NAME.; |
| 871 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Fromrust-analyzer cargo notify-types 2.1.0 event/RenameMode#From#)))); |
| 872 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Torust-analyzer cargo notify-types 2.1.0 event/RenameMode#To#)))); |
| 873 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Bothrust-analyzer cargo notify-types 2.1.0 event/RenameMode#Both#)))); |
| 874 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 875 | } |
| 876 | |
| 877 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 878 | fn all_modify_matches_data_meta_namerust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/all_modify_matches_data_meta_name().() { |
| 879 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALL_MODIFYrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_MODIFY.; |
| 880 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 881 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Any#)))); |
| 882 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Fromrust-analyzer cargo notify-types 2.1.0 event/RenameMode#From#)))); |
| 883 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Any#))); |
| 884 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Other#))); |
| 885 | } |
| 886 | |
| 887 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 888 | fn any_and_other_always_passrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/any_and_other_always_pass().() { |
| 889 | let empty = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::emptyrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]empty().(); |
| 890 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any#)); |
| 891 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other#)); |
| 892 | } |
| 893 | |
| 894 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 895 | fn core_excludes_accessrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/core_excludes_access().() { |
| 896 | let core = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::CORErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CORE.; |
| 897 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 898 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#))); |
| 899 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 900 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Metadatarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Metadata#(MetadataKindrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/MetadataKind#Any#)))); |
| 901 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Namerust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Name#(RenameModerust-analyzer cargo notify-types 2.1.0 event/RenameMode#::Fromrust-analyzer cargo notify-types 2.1.0 event/RenameMode#From#)))); |
| 902 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 903 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().core.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 904 | } |
| 905 | |
| 906 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 907 | fn empty_mask_only_passes_any_otherrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/empty_mask_only_passes_any_other().() { |
| 908 | let empty = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::emptyrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]empty().(); |
| 909 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any#)); |
| 910 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other#)); |
| 911 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 912 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#))); |
| 913 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 914 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().empty.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 915 | } |
| 916 | |
| 917 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 918 | fn bitwise_or_combines_masksrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/bitwise_or_combines_masks().() { |
| 919 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::CREATErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]CREATE. rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().|rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor(). rust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask][`BitOr<Self>`]bitor().EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::REMOVErust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]REMOVE.; |
| 920 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 921 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Folderrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#Folder#))); |
| 922 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 923 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 924 | } |
| 925 | |
| 926 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 927 | fn all_matches_everythingrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/all_matches_everything().() { |
| 928 | let all = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALLrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL.; |
| 929 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any#)); |
| 930 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/EventKind#Other#)); |
| 931 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Createrust-analyzer cargo notify-types 2.1.0 event/EventKind#Create#(CreateKindrust-analyzer cargo notify-types 2.1.0 event/CreateKind#::Filerust-analyzer cargo notify-types 2.1.0 event/CreateKind#File#))); |
| 932 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Removerust-analyzer cargo notify-types 2.1.0 event/EventKind#Remove#(RemoveKindrust-analyzer cargo notify-types 2.1.0 event/RemoveKind#::Filerust-analyzer cargo notify-types 2.1.0 event/RemoveKind#File#))); |
| 933 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Modifyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Modify#(ModifyKindrust-analyzer cargo notify-types 2.1.0 event/ModifyKind#::Datarust-analyzer cargo notify-types 2.1.0 event/ModifyKind#Data#(DataChangerust-analyzer cargo notify-types 2.1.0 event/DataChange#::Anyrust-analyzer cargo notify-types 2.1.0 event/DataChange#Any#)))); |
| 934 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Openrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Open#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessMode#Any#)))); |
| 935 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(all.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Closerust-analyzer cargo notify-types 2.1.0 event/AccessKind#Close#(AccessModerust-analyzer cargo notify-types 2.1.0 event/AccessMode#::Writerust-analyzer cargo notify-types 2.1.0 event/AccessMode#Write#)))); |
| 936 | } |
| 937 | |
| 938 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 939 | fn access_read_and_any_match_with_all_accessrust-analyzer cargo notify-types 2.1.0 event/event_kind_mask_tests/access_read_and_any_match_with_all_access().() { |
| 940 | // Edge case: AccessKind::Read and AccessKind::Any should match if ALL_ACCESS is set |
| 941 | let mask = EventKindMaskrust-analyzer cargo notify-types 2.1.0 event/EventKindMask#::ALL_ACCESSrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]ALL_ACCESS.; |
| 942 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Readrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Read#))); |
| 943 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Any#))); |
| 944 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(mask.matchesrust-analyzer cargo notify-types 2.1.0 event/impl#[EventKindMask]matches().(&EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Accessrust-analyzer cargo notify-types 2.1.0 event/EventKind#Access#(AccessKindrust-analyzer cargo notify-types 2.1.0 event/AccessKind#::Otherrust-analyzer cargo notify-types 2.1.0 event/AccessKind#Other#))); |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | #[cfg(all(test, feature = "serde", not(feature = "serialization-compat-6")))] |
| 949 | mod tests { |
| 950 | use superrust-analyzer cargo notify-types 2.1.0 crate/::*; |
| 951 | |
| 952 | use instarust-analyzer cargo insta 1.46.1 crate/::assert_snapshotrust-analyzer cargo insta 1.46.1 macros/assert_snapshot!; |
| 953 | use rstestrust-analyzer cargo rstest 0.26.1 crate/::rstestrust-analyzer cargo rstest_macros 0.26.1 rstest:; |
| 954 | |
| 955 | #[rustfmt::skip] |
| 956 | #[rstest] |
| 957 | #[case("any", EventKind::Any)] |
| 958 | #[case("access-any", EventKind::Access(AccessKind::Any))] |
| 959 | #[case("access-read", EventKind::Access(AccessKind::Read))] |
| 960 | #[case("access-open-any", EventKind::Access(AccessKind::Open(AccessMode::Any)))] |
| 961 | #[case("access-open-execute", EventKind::Access(AccessKind::Open(AccessMode::Execute)))] |
| 962 | #[case("access-open-read", EventKind::Access(AccessKind::Open(AccessMode::Read)))] |
| 963 | #[case("access-open-write", EventKind::Access(AccessKind::Open(AccessMode::Write)))] |
| 964 | #[case("access-open-other", EventKind::Access(AccessKind::Open(AccessMode::Other)))] |
| 965 | #[case("access-close-any", EventKind::Access(AccessKind::Close(AccessMode::Any)))] |
| 966 | #[case("access-close-execute", EventKind::Access(AccessKind::Close(AccessMode::Execute)))] |
| 967 | #[case("access-close-read", EventKind::Access(AccessKind::Close(AccessMode::Read)))] |
| 968 | #[case("access-close-write", EventKind::Access(AccessKind::Close(AccessMode::Write)))] |
| 969 | #[case("access-close-other", EventKind::Access(AccessKind::Close(AccessMode::Other)))] |
| 970 | #[case("access-other", EventKind::Access(AccessKind::Other))] |
| 971 | #[case("create-any", EventKind::Create(CreateKind::Any))] |
| 972 | #[case("create-file", EventKind::Create(CreateKind::File))] |
| 973 | #[case("create-folder", EventKind::Create(CreateKind::Folder))] |
| 974 | #[case("create-other", EventKind::Create(CreateKind::Other))] |
| 975 | #[case("modify-any", EventKind::Modify(ModifyKind::Any))] |
| 976 | #[case("modify-data-any", EventKind::Modify(ModifyKind::Data(DataChange::Any)))] |
| 977 | #[case("modify-data-size", EventKind::Modify(ModifyKind::Data(DataChange::Size)))] |
| 978 | #[case("modify-data-content", EventKind::Modify(ModifyKind::Data(DataChange::Content)))] |
| 979 | #[case("modify-data-other", EventKind::Modify(ModifyKind::Data(DataChange::Other)))] |
| 980 | #[case("modify-metadata-any", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Any)))] |
| 981 | #[case("modify-metadata-accesstime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::AccessTime)))] |
| 982 | #[case("modify-metadata-writetime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::WriteTime)))] |
| 983 | #[case("modify-metadata-permissions", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Permissions)))] |
| 984 | #[case("modify-metadata-ownership", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Ownership)))] |
| 985 | #[case("modify-metadata-extended", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Extended)))] |
| 986 | #[case("modify-metadata-other", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Other)))] |
| 987 | #[case("modify-name-any", EventKind::Modify(ModifyKind::Name(RenameMode::Any)))] |
| 988 | #[case("modify-name-to", EventKind::Modify(ModifyKind::Name(RenameMode::To)))] |
| 989 | #[case("modify-name-from", EventKind::Modify(ModifyKind::Name(RenameMode::From)))] |
| 990 | #[case("modify-name-both", EventKind::Modify(ModifyKind::Name(RenameMode::Both)))] |
| 991 | #[case("modify-name-other", EventKind::Modify(ModifyKind::Name(RenameMode::Other)))] |
| 992 | #[case("modify-other", EventKind::Modify(ModifyKind::Other))] |
| 993 | #[case("remove-any", EventKind::Remove(RemoveKind::Any))] |
| 994 | #[case("remove-file", EventKind::Remove(RemoveKind::File))] |
| 995 | #[case("remove-folder", EventKind::Remove(RemoveKind::Folder))] |
| 996 | #[case("remove-other", EventKind::Remove(RemoveKind::Other))] |
| 997 | #[case("other", EventKind::Other)] |
| 998 | fn serialize_event_kind( |
| 999 | #[case] name: &str, |
| 1000 | #[case] event_kind: EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#, |
| 1001 | ) { |
| 1002 | let event = Eventrust-analyzer cargo notify-types 2.1.0 event/Event#::new(event_kind); |
| 1003 | let json = serde_jsonrust-analyzer cargo serde_json 1.0.149 crate/::to_stringrust-analyzer cargo serde_json 1.0.149 ser/to_string().(&event).unwrap(); |
| 1004 | assert_snapshot!(name, json); |
| 1005 | } |
| 1006 | |
| 1007 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1008 | fn serialize_event_with_attrs() { |
| 1009 | let event = Eventrust-analyzer cargo notify-types 2.1.0 event/Event#::new(EventKindrust-analyzer cargo notify-types 2.1.0 event/EventKind#::Anyrust-analyzer cargo notify-types 2.1.0 event/EventKind#Any#) |
| 1010 | .set_tracker(123) |
| 1011 | .set_flag(Flagrust-analyzer cargo notify-types 2.1.0 event/Flag#::Rescanrust-analyzer cargo notify-types 2.1.0 event/Flag#Rescan#) |
| 1012 | .set_info("test event") |
| 1013 | .set_process_id(0); |
| 1014 | let json = serde_jsonrust-analyzer cargo serde_json 1.0.149 crate/::to_stringrust-analyzer cargo serde_json 1.0.149 ser/to_string().(&event).unwrap(); |
| 1015 | assert_snapshot!(json); |
| 1016 | } |
| 1017 | } |