std-module

std::ascii — ASCII-only utilities

ASCII covers values 0 through 127. Use ASCII operations for explicitly ASCII protocol fields; they are not multilingual text processing. Expected stdout (not executed): \n Common mistake: Assuming every UTF-8 byte is a separate ASCII character.

Formal Syntax & Structure

rust syntaxrust
std::ascii::escape_default(byte)

Working Example

Example Snippetrust
fn main() {    let escaped: String = std::ascii::escape_default(b'\n').map(char::from).collect();    println!("{escaped}");}
Rust Reference