Expand description
§Obel Platform
§Overview
obel_platform is a specialized crate designed to enhance cross-platform development
for Obel game engine projects. While Rust’s standard library provides excellent multi-platform support,
this crate offers optimized alternatives specifically tailored for game development and embedded systems.
Key benefits:
- Platform-optimized alternatives to standard library components
- First-class support for
no_stdenvironments - Seamless integration with Bevy ecosystem
§Installation
Add the crate to your project using cargo:
cargo add obel_platform§Usage
Simply import from obel_platform instead of std for supported items. Refer to the documentation for available items and their benefits.
§Features
§Standard Library Support (std) [default]
- Enables standard library integration
- Provides optimized alternatives where beneficial
- Incompatible with
no_stdtargets
§Allocation Support (alloc) [default]
- Enables
alloccrate functionality - Automatically enabled with
stdfeature - Compatible with most
no_stdtargets
§Portable Atomics (portable-atomic)
- Uses
portable-atomicfor atomic operations - Essential for platforms with limited atomic operation support
- Provides consistent atomic behavior across platforms
§Critical Section Support (critical-section)
- Implements synchronization using
critical-section - Ideal for platforms with minimal atomic operation support
- Often used in conjunction with
portable-atomic
§No-std Configuration
To use on generic(no_std) platforms, disable default features but enable other feature in your Cargo.toml:
obel_platform = { version = "x.y.z", default-features = false, features = ["generic"] }Modules§
- borrow
- Platform-agnostic impls to
alloc::borrowitems - boxed
- Platform-agnostic impls to
alloc::boxeditems - collections
- Collection types and utilities for working with collections in a platform-agnostic way.
- hash
- Provides replacements for
std::hashitems usingfoldhash. - string
- Platform-agnostic impls to
stringitems - sync
- Provides various synchronization alternatives to language primitives.
- time
- Provides
Instantfor all platforms. - utils
- General utilities for first-party obel engine crates.
- vec
- Platform-agnostic impls to
vecitems
Macros§
- run_
once - A macro that ensures the given expression is executed exactly once per call site.