How to create large custom number types like u160 in Rust?
11:03 31 Oct 2021

The uX crate simplifies creation of non-standard width integers but is unfortunately limited till u128.

From uX docs:

When non-standard-width integers is required in an applications, the norm is to use a larger container and make sure the value is within range after manipulation.

However u126 is the max natively supported unsigned number type.

Edit: Earlier I mentioned adding a type check to u256. But Rust does not have a native u256.

rust casting