diskann_platform/
lib.rs

1/*
2 * Copyright (c) Microsoft Corporation. All rights reserved.
3 * Licensed under the MIT license.
4 */
5#![cfg_attr(
6    not(test),
7    warn(clippy::panic, clippy::unwrap_used, clippy::expect_used)
8)]
9
10cfg_if::cfg_if! {
11    if #[cfg(target_os = "windows")] {
12        pub mod perf;
13        pub use perf::{get_process_cycle_time, get_process_handle};
14
15        pub mod file_io;
16        pub use file_io::{get_queued_completion_status, read_file_to_slice};
17
18        pub mod file_handle;
19        pub use file_handle::FileHandle;
20
21        pub mod io_completion_port;
22        pub use io_completion_port::IOCompletionPort;
23    } else {
24        // For non-Windows platforms, we'll use simplified implementations
25        // In a production environment, you would implement platform-specific optimizations
26        pub mod perf_generic;
27        pub use perf_generic::{get_process_cycle_time, get_process_handle};
28
29        pub mod file_io_generic;
30        pub use file_io_generic::{read_file_to_slice, get_io_completion_status};
31
32        pub mod file_handle_generic;
33        pub use file_handle_generic::FileHandle;
34
35        pub mod io_completion_port_generic;
36        pub use io_completion_port_generic::IOCompletionPort;
37    }
38}