cros_async/sys/
linux.rs

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
5pub mod async_types;
6mod error;
7pub mod event;
8pub mod executor;
9pub mod fd_executor;
10pub mod poll_source;
11mod timer;
12#[cfg(feature = "tokio")]
13pub mod tokio_source;
14pub mod uring_executor;
15pub mod uring_source;
16
17pub use error::AsyncErrorSys;
18pub use executor::ExecutorKindSys;
19pub(crate) use fd_executor::EpollReactor;
20pub use poll_source::Error as PollSourceError;
21pub use poll_source::PollSource;
22pub(crate) use uring_executor::UringReactor;
23pub use uring_source::UringSource;
24
25use crate::Error;
26
27impl From<Error> for std::io::Error {
28    fn from(e: Error) -> Self {
29        use Error::*;
30        match e {
31            EventAsync(e) => e.into(),
32            Io(e) => e,
33            URingExecutor(e) => e.into(),
34            PollSource(e) => e.into(),
35            Timer(e) => e.into(),
36            TimerAsync(e) => e.into(),
37        }
38    }
39}