Function lazy_bytes_cast::bytes_cast
[−]
[src]
pub fn bytes_cast<T: ToBytesCast>(bytes: &[u8]) -> Result<T, ()>
Converts slice of bytes to an integer.
Note:
To be safe this function allows conversion only to types that implements ToBytesCast
.
Parameters:
bytes
- slice of bytes to convert
Result:
Ok
- Converted integer.Err
- Insufficient bytes size for a cast.