Function std::old_io::extensions::u64_to_be_bytesUnstable
[-] [+]
[src]
pub fn u64_to_be_bytes<T, F>(n: u64, size: usize, f: F) -> T where F: FnOnce(&[u8]) -> T
Converts an 8-bit to 64-bit unsigned value to a big-endian byte representation of the given size. If the size is not big enough to represent the value, then the high-order bytes are truncated.
Arguments:
n
: The value to convert.size
: The size of the value, in bytes. This must be 8 or less, or task panic occurs. If this is less than 8, then a value of that many bytes is produced. For example, ifsize
is 4, then a 32-bit byte representation is produced.f
: A callback that receives the value.
This function returns the value returned by the callback, for convenience.