Module util

Source
Expand description

A set of helper tools and functions.

Modulesยง

decode ๐Ÿ”’
encode ๐Ÿ”’
path ๐Ÿ”’

Functionsยง

decode
Decodes a given type T from the given slice. returns the decoded value along with the number of bytes read.
encode
Encode the given type T into a Vec<u8>.
encode_into_slice
Encode the given type T into the given slice..
home_dir
Returns the userโ€™s home directory as a PathBuf.
random_16
Generates and returns a random u16 using rand::rngs::OsRng.
random_32
Generates and returns a random u32 using rand::rngs::OsRng.
random_64
Generates and returns a random u64 using rand::rngs::OsRng.
tilde_expand
Expands a tilde (~) in a path and returns the expanded PathBuf.