1 // Copyright 2021 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 pub mod async_types; 6 mod error; 7 pub mod event; 8 pub mod executor; 9 pub mod handle_executor; 10 pub mod handle_source; 11 mod io_completion_port; 12 pub mod overlapped_source; 13 mod timer; 14 #[cfg(feature = "tokio")] 15 pub mod tokio_source; 16 17 pub use error::AsyncErrorSys; 18 pub use executor::ExecutorKindSys; 19 pub use handle_executor::HandleReactor; 20 pub use handle_source::HandleSource; 21 pub use handle_source::HandleWrapper; 22 pub use overlapped_source::OverlappedSource; 23 24 use crate::Error; 25 26 impl From<Error> for std::io::Error { from(e: Error) -> Self27 fn from(e: Error) -> Self { 28 use Error::*; 29 match e { 30 EventAsync(e) => e.into(), 31 HandleExecutor(e) => e.into(), 32 Io(e) => e, 33 Timer(e) => e.into(), 34 TimerAsync(e) => e.into(), 35 } 36 } 37 } 38