Skip to main content

typed_path/
lib.rs

1#![cfg_attr(feature = "std", doc = include_str!("../README.md"))]
2#![cfg_attr(not(feature = "std"), no_std)]
3#![cfg_attr(
4    all(feature = "nightly-wasip2", target_os = "wasi", target_env = "p2"),
5    feature(wasip2)
6)]
7
8#[doc = include_str!("../README.md")]
9#[cfg(all(doctest, feature = "std"))]
10pub struct ReadmeDoctests;
11
12extern crate alloc;
13
14mod no_std_compat {
15    #[allow(unused_imports)]
16    pub use alloc::{
17        boxed::Box,
18        string::{String, ToString},
19        vec,
20        vec::Vec,
21    };
22}
23
24#[macro_use]
25mod common;
26#[cfg(all(not(target_family = "wasm"), any(windows, unix)))]
27mod native;
28#[cfg(all(not(target_family = "wasm"), any(windows, unix)))]
29mod platform;
30mod typed;
31mod unix;
32#[cfg(all(feature = "std", not(target_family = "wasm")))]
33pub mod utils;
34mod windows;
35
36mod private {
37    /// Used to mark traits as sealed to prevent implements from others outside of this crate
38    pub trait Sealed {}
39}
40
41pub use common::*;
42#[cfg(all(not(target_family = "wasm"), any(windows, unix)))]
43pub use native::*;
44#[cfg(all(not(target_family = "wasm"), any(windows, unix)))]
45pub use platform::*;
46pub use typed::*;
47pub use unix::*;
48pub use windows::*;
49
50/// Contains constants associated with different path formats.
51pub mod constants {
52    use super::unix::constants as unix_constants;
53    use super::windows::constants as windows_constants;
54
55    /// Contains constants associated with Unix paths.
56    pub mod unix {
57        pub use super::unix_constants::*;
58    }
59
60    /// Contains constants associated with Windows paths.
61    pub mod windows {
62        pub use super::windows_constants::*;
63    }
64}