explicit_cast 1.0.0

A crate for explicit widening, truncating, and sign casting of primitive integers
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented4 out of 11 items with examples
  • Size
  • Source code size: 21.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.65 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • ultrabear/explicit_cast
    1 0 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ultrabear

explicit_cast

A crate for explicitly widening, truncating, and sign casting integers.
This crate is very simple, but the functionality it provides is universal, as such, it is distributed under Apache-2.0 OR MIT.

Usage

use explict_cast::prelude::*;

let my_value: u8 = u16::MAX.truncate();
let next: i16 = my_value.widen().sign_cast();

assert_eq!(next, 0xffi16);