pub unsafe trait UsizeAssert: Sized {
type Type;
const LHS: usize;
const RHS: usize;
const COMPARE: Comparison;
const PROPERTY: &'static str;
const FAILED: bool = _;
// Provided method
fn assert() { ... }
}Expand description
Compile time evaluable assert for usize values.
See module docs for what happens when an assertion fails.
§Safety
Self::assert() and Self::FAILED must keep the default implementation.
Required Associated Constants§
Sourceconst COMPARE: Comparison
const COMPARE: Comparison
Provided Associated Constants§
Sourceconst FAILED: bool = _
const FAILED: bool = _
Associated constant used to trigger compile time errors.
By making rustc evaluate this constant, you can trigger a compile time error.
See module docs for details.
Required Associated Types§
Provided Methods§
Sourcefn assert()
fn assert()
Assert the defined comparison is true.
§Panics
This function will panic if the DUNGEON_CELL_RUNTIME_CHECKS environment variable is
set and the assertion fails.
Otherwise, this function is a no-op for the program.
See module docs for details.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.