Crates.io | platform-cast |
lib.rs | platform-cast |
version | 0.1.0 |
created_at | 2025-05-14 14:18:47.473892+00 |
updated_at | 2025-05-14 14:18:47.473892+00 |
description | Platform-specific safe cast. |
homepage | |
repository | https://github.com/tyilo/platform-cast |
max_upload_size | |
id | 1673467 |
size | 19,879 |
Platform-specific safe cast.
From |
TryFrom |
as cast |
CastFrom |
|
---|---|---|---|---|
No runtime check | ✅ | ❌ | ✅ | ✅ |
usize <-> u64 1 |
❌ | ✅ | ✅ | ✅ |
No truncation | ✅ | ✅ | ❌ | ✅ |
No change of sign | ✅ | ✅ | ❌ | ✅ |
Assuming a target with a pointer width of 64. ↩