Skip to main content

diskann_utils/
lib.rs

1/*
2 * Copyright (c) Microsoft Corporation.
3 * Licensed under the MIT license.
4 */
5
6#[cfg(not(target_endian = "little"))]
7compile_error!("diskann-utils assumes little-endian targets");
8
9pub mod reborrow;
10pub use reborrow::{Reborrow, ReborrowMut};
11
12pub mod lifetime;
13pub use lifetime::WithLifetime;
14
15pub mod future;
16
17pub mod io;
18pub mod object_pool;
19pub mod sampling;
20
21// Views
22pub mod strided;
23pub mod views;
24
25mod lazystring;
26pub use lazystring::LazyString;
27
28#[cfg(feature = "testing")]
29#[doc(hidden)]
30pub fn workspace_root() -> std::path::PathBuf {
31    std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
32        .parent()
33        .unwrap()
34        .to_path_buf()
35}
36
37#[cfg(feature = "testing")]
38#[doc(hidden)]
39pub fn test_data_directory() -> &'static str {
40    "test_data"
41}
42
43#[cfg(feature = "testing")]
44#[doc(hidden)]
45pub fn test_data_root() -> std::path::PathBuf {
46    workspace_root().join(test_data_directory())
47}