| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#, DerefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/DerefMut#}; |
| 2 | |
| 3 | #[cfg(feature = "web-time")] |
| 4 | use web_time::Instant; |
| 5 | |
| 6 | #[cfg(not(feature = "web-time"))] |
| 7 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Instantrust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/Instant#; |
| 8 | |
| 9 | use craterust-analyzer cargo notify-types 2.1.0 crate/::eventrust-analyzer cargo notify-types 2.1.0 event/::Eventrust-analyzer cargo notify-types 2.1.0 event/Event#; |
| 10 | |
| 11 | /// A debounced event is emitted after a short delay. |
| 12 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, 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:)] |
| 13 | pub struct DebouncedEventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent# { |
| 14 | /// The original event. |
| 15 | pub eventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#event.: Eventrust-analyzer cargo notify-types 2.1.0 event/Event#, |
| 16 | |
| 17 | /// The time at which the event occurred. |
| 18 | pub timerust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#time.: Instantrust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/Instant#, |
| 19 | } |
| 20 | |
| 21 | impl DebouncedEventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent# { |
| 22 | pub fn newrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent]new().(event: Eventrust-analyzer cargo notify-types 2.1.0 event/Event#, time: Instantrust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/Instant#) -> Selfrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent] { |
| 23 | Selfrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent] { eventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#event., timerust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#time. } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | impl Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref# for DebouncedEventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent# { |
| 28 | type Targetrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent][Deref]Target# = Eventrust-analyzer cargo notify-types 2.1.0 event/Event#; |
| 29 | |
| 30 | fn derefrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent][Deref]deref().(&self) -> &Selfrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent][Deref]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# { |
| 31 | &self.eventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#event. |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | impl DerefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/DerefMut# for DebouncedEventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent# { |
| 36 | fn deref_mutrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent][DerefMut]deref_mut().(&mut self) -> &mut Selfrust-analyzer cargo notify-types 2.1.0 debouncer_full/impl#[DebouncedEvent][DerefMut]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# { |
| 37 | &mut self.eventrust-analyzer cargo notify-types 2.1.0 debouncer_full/DebouncedEvent#event. |
| 38 | } |
| 39 | } |