Skip to main content

pyo3/
platform.rs

1//! This module is to support platform compatibility with `no_std` environments.
2#![allow(unused_imports)]
3
4/// This prelude is intended to be used instead of the prelude from `std`.
5pub(crate) mod prelude {
6    pub use alloc::{
7        borrow::ToOwned,
8        boxed::Box,
9        string::{String, ToString},
10        vec::Vec,
11    };
12
13    // TODO find a `no_std` replacement for eprintln
14    pub use std::eprintln;
15}
16
17#[cfg(feature = "hashbrown")]
18pub use hashbrown::{HashMap, HashSet};
19
20#[cfg(all(not(feature = "hashbrown"), wip_feature_std))]
21pub use std::collections::{HashMap, HashSet};
22
23#[cfg(all(not(feature = "hashbrown"), not(wip_feature_std)))]
24compile_error!("Please enable at least one of the following features: hashbrown, std");
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here