1 // Copyright 2020 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use base::Event; 6 7 use crate::IntoAsync; 8 use crate::IoSource; 9 10 /// An async version of `base::Event`. 11 pub struct EventAsync { 12 pub(crate) io_source: IoSource<Event>, 13 #[cfg(windows)] 14 pub(crate) reset_after_read: bool, 15 } 16 17 impl EventAsync { get_io_source_ref(&self) -> &IoSource<Event>18 pub fn get_io_source_ref(&self) -> &IoSource<Event> { 19 &self.io_source 20 } 21 } 22 23 impl IntoAsync for Event {} 24 25 // Safe because an `Event` is used underneath, which is safe to pass between threads. 26 unsafe impl Send for EventAsync {} 27