An open API service indexing awesome lists of open source software.

https://github.com/tyilo/platform-cast


https://github.com/tyilo/platform-cast

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# platform-cast [![Latest Version]][crates.io] [![API Docs]][docs.rs]

[Latest Version]: https://img.shields.io/crates/v/platform-cast.svg
[crates.io]: https://crates.io/crates/platform-cast
[API Docs]: https://img.shields.io/docsrs/platform-cast.svg
[docs.rs]: https://docs.rs/platform-cast

Platform-specific safe cast.

| | `From` | `TryFrom` | `as` cast | `CastFrom` |
| ------------------------- | -------- | ----------- | --------- | ---------- |
| No runtime check | ✅ | ❌ | ✅ | ✅ |
| `usize` <-> `u64`[^a] | ❌ | ✅ | ✅ | ✅ |
| No truncation | ✅ | ✅ | ❌ | ✅ |
| No change of sign | ✅ | ✅ | ❌ | ✅ |

[^a]: Assuming a target with a pointer width of 64.