Skip to main content

Crate semisafe

Crate semisafe 

Source
Expand description

semisafe is a crate containing semi-safe utilities for performance-critical Rust code. Every function in this crate is safe in debug mode and unsafe in release mode. This is meant to provide an improved alternative to strictly-unsafe methods like get_unchecked.

  • Only use these methods in places where the code should NEVER panic. Treat them as unchecked methods.
  • You should have comprehensive automated tests around code when using these functions. Run them in debug mode to catch unexpected behavior. Distribute in release mode to get the performance benefits.

Disclaimer: YOU PROBABLY DON’T NEED THIS CRATE. IF YOU AREN’T SURE WHETHER YOU NEED THIS CRATE, THEN YOU DON’T NEED THIS CRATE. This crate is intended for low-level, performance-critical code. You do not need it for everyday applications.

Modules§

cmp
Provides semi-safe helpers for comparison operations.
nonzero
Provides semi-safe helpers for NonZero integer types.
option
Provides semi-safe helpers for the Option type.
result
Provides semi-safe helpers for the Result type.
slice
Provides semi-safe helpers for the slice type.