The snippet library.
Small, practical examples. Search by task or narrow things down below.
Decode bytes as validated UTF-8
Decode bytes as validated UTF-8 in a complete Rust program using the standard library.
Rust✓ Tested
Detect invalid UTF-8 data
Detect invalid UTF-8 data in a complete Rust program using the standard library.
Rust✓ Tested
Encode an integer as big-endian bytes
Encode an integer as big-endian bytes in a complete Rust program using the standard library.
Rust✓ Tested
Format an integer as padded hexadecimal
Format an integer as padded hexadecimal in a complete Rust program using the standard library.
Rust✓ Tested
Parse a Boolean literal
Parse a Boolean literal in a complete Rust program using the standard library.
Rust✓ Tested
Parse a delimited integer record
Parse a delimited integer record in a complete Rust program using the standard library.
Rust✓ Tested
Parse a hexadecimal integer
Parse a hexadecimal integer in a complete Rust program using the standard library.
Rust✓ Tested
Parse a signed decimal integer
Parse a signed decimal integer in a complete Rust program using the standard library.
Rust✓ Tested
Read a little-endian integer from bytes
Read a little-endian integer from bytes in a complete Rust program using the standard library.
Rust✓ Tested