Expand description
§std shims
std-shims is a Rust crate with two purposes:
- Expand the functionality of
coreandalloc - Polyfill functionality only available on newer version of Rust
The goal is to make supporting no-std environments, and older versions of
Rust, as simple as possible. For most use cases, replacing std:: with
std_shims:: and adding use std_shims::prelude::* is sufficient to take full
advantage of std-shims.
§API Surface
std-shims only aims to have items mutually available between alloc (with
extra dependencies) and std publicly exposed. Items exclusive to std, with
no shims available, will not be exported by std-shims.
§Dependencies
HashSet and HashMap are provided via hashbrown. Synchronization
primitives are provided via spin (avoiding a requirement on
critical-section). Sections of std::io are independently matched as
possible. rustversion is used to detect when to provide polyfills.
§Disclaimer
No guarantee of one-to-one parity is provided. The shims provided aim to be sufficient for the average case. Pull requests are welcome.
Modules§
- alloc
std - Memory allocation APIs.
- borrow
std - A module for working with borrowed data.
- boxed
std - The
Box<T>type for heap allocation. - collections
- error
std - Interfaces for working with Errors.
- ffi
std - Utilities related to FFI bindings.
- fmt
std - Utilities for formatting and printing
Strings. - io
- prelude
- rc
std - Single-threaded reference-counting pointers. ‘Rc’ stands for ‘Reference Counted’.
- slice
std - Utilities for the slice primitive type.
- str
std - Utilities for the
strprimitive type. - string
std - A UTF-8–encoded, growable string.
- sync
- task
std - Types and Traits for working with asynchronous tasks.
- vec
std - A contiguous growable array type with heap-allocated contents, written
Vec<T>.