Crate no_std_compat2

source ·
Expand description

Feature flags

  • alloc — This feature pulls in alloc and exposes it in all the usual locations. I.e std::collection gets mapped to alloc::collections and all the allocation stuff is added to the prelude.

  • std — This feature pulls in the entire standard library and overrides all other features. This effectively bypasses this crate completely. This is here to avoid needing feature gates: Just forward your optional std feature to here, we handle the rest.

  • unstable — This feature also re-exports all unstable modules, which isn’t possible to do unless you compile with nightly. Unless you need an unstable module, this crate supports stable rust.

  • compat_hash — This pulls in hashbrown (which is not HashDoS-resistant!! but #![no_std]). The point is so you can keep using the standard, safe, HashMap for those who have the standard library, and fall back to a less ideal alternative for those who do not. Be advised, however, that this used in a public function signature could be confusing and should perhaps be avoided. But that is up to you!

  • compat_sync — This pulls in spin and provides replacements for several things used in std::sync.

  • compat_macros — This feature adds dummy println, eprintln, dbg, etc. implementations that do absolutely nothing. The point is that any debug functions or other loggings that are not required for the library to function, just stay silent in no_std.

  • compat_cstr — Enable CStr

  • compat_osraw — Enable std::os::raw

  • compat_path — Enable std::path

  • compat_guard_unwrap — .

Modules

Macros

  • dbgNon-std and compat_macros
  • eprintNon-std and compat_macros
  • eprintlnNon-std and compat_macros
  • printNon-std and compat_macros
  • printlnNon-std and compat_macros