Crate deranged

Source
Expand description

deranged is a proof-of-concept implementation of ranged integers.

Modules§

  • traits 🔒
    Declaration and implementation of traits used for const assertions.
  • Declaration and implementation of Unsafe, which ensures all unsafe operations are correctly placed in unsafe blocks.

Macros§

  • article 🔒
    "A" if true, "An" if false.
  • ? for Option types, usable in const contexts.
  • Output the provided code if and only if the list does not include rand_09.
  • if_signed 🔒
    Output the given tokens if the type is signed, otherwise output nothing.
  • Output the given tokens if the type is unsigned, otherwise output nothing.
  • Implement a ranged integer type.
  • Option::unwrap_unchecked, but usable in const contexts.

Structs§

  • An optional RangedI8; similar to Option<RangedI8> with better optimization.
  • An optional RangedI16; similar to Option<RangedI16> with better optimization.
  • An optional RangedI32; similar to Option<RangedI32> with better optimization.
  • An optional RangedI64; similar to Option<RangedI64> with better optimization.
  • An optional RangedI128; similar to Option<RangedI128> with better optimization.
  • An optional RangedIsize; similar to Option<RangedIsize> with better optimization.
  • An optional RangedU8; similar to Option<RangedU8> with better optimization.
  • An optional RangedU16; similar to Option<RangedU16> with better optimization.
  • An optional RangedU32; similar to Option<RangedU32> with better optimization.
  • An optional RangedU64; similar to Option<RangedU64> with better optimization.
  • An optional RangedU128; similar to Option<RangedU128> with better optimization.
  • An optional RangedUsize; similar to Option<RangedUsize> with better optimization.
  • An error which can be returned when parsing an integer.
  • An i8 that is known to be in the range MIN..=MAX.
  • An i16 that is known to be in the range MIN..=MAX.
  • An i32 that is known to be in the range MIN..=MAX.
  • An i64 that is known to be in the range MIN..=MAX.
  • An i128 that is known to be in the range MIN..=MAX.
  • An isize that is known to be in the range MIN..=MAX.
  • A u8 that is known to be in the range MIN..=MAX.
  • A u16 that is known to be in the range MIN..=MAX.
  • A u32 that is known to be in the range MIN..=MAX.
  • A u64 that is known to be in the range MIN..=MAX.
  • A u128 that is known to be in the range MIN..=MAX.
  • A usize that is known to be in the range MIN..=MAX.
  • The error type returned when a checked integral type conversion fails.

Functions§

  • Informs the optimizer that a condition is always true. If the condition is false, the behavior is undefined.