ASCII character classes and case conversion.
Functions
is_upper | Whether b is an ASCII uppercase letter. |
is_lower | Whether b is an ASCII lowercase letter. |
is_alpha | Whether b is an ASCII letter. |
is_digit | Whether b is an ASCII decimal digit. |
is_hex_digit | Whether b is an ASCII hexadecimal digit, in either case. |
is_alnum | Whether b is an ASCII letter or digit. |
is_space | Whether b is ASCII whitespace: space, tab, newline, vertical tab, form feed or carriage return. |
to_lower | b in lowercase when it is an ASCII uppercase letter, else b itself. |
to_upper | b in uppercase when it is an ASCII lowercase letter, else b itself. |
space_prefix | How many whitespace bytes (is_space) bytes starts with. |
space_suffix | How many whitespace bytes bytes ends with: all of them when it is whitespace throughout. |
line_at | The line starting at start, without its '\n', and where the next line starts; nothing once start is past the end. |
word_at | The next whitespace-separated word at or after start, and where the search for the one after it starts; nothing when only whitespace is left. |
Function declarations
fn is_uppersource
fn is_upper(b: u8) -> bool { ... }
Whether b is an ASCII uppercase letter.
fn is_lowersource
fn is_lower(b: u8) -> bool { ... }
Whether b is an ASCII lowercase letter.
fn is_alphasource
fn is_alpha(b: u8) -> bool { ... }
Whether b is an ASCII letter.
fn is_digitsource
fn is_digit(b: u8) -> bool { ... }
Whether b is an ASCII decimal digit.
fn is_hex_digitsource
fn is_hex_digit(b: u8) -> bool { ... }
Whether b is an ASCII hexadecimal digit, in either case.
fn is_alnumsource
fn is_alnum(b: u8) -> bool { ... }
Whether b is an ASCII letter or digit.
fn is_spacesource
fn is_space(b: u8) -> bool { ... }
Whether b is ASCII whitespace: space, tab, newline, vertical tab, form feed or carriage return.
fn to_lowersource
fn to_lower(b: u8) -> u8 { ... }
b in lowercase when it is an ASCII uppercase letter, else b itself.
fn to_uppersource
fn to_upper(b: u8) -> u8 { ... }
b in uppercase when it is an ASCII lowercase letter, else b itself.
fn space_prefixsource
forall C, S where ReadBytes[C, S], Copy[S].
fn space_prefix(&cx: C, bytes: S) -> usize { ... }
How many whitespace bytes (is_space) bytes starts with.
fn space_suffixsource
forall C, S where ReadBytes[C, S], Copy[S].
fn space_suffix(&cx: C, bytes: S) -> usize { ... }
How many whitespace bytes bytes ends with: all of them when it is whitespace throughout.
fn line_atsource
forall C, 'k where ReadBytes[C, Str['k]].
fn line_at(&cx: C, bytes: Str['k], start: usize) -> Option[(Str['k], usize)] { ... }
The line starting at start, without its '\n', and where the next line starts; nothing once start is past the end. A final line need not end with '\n'.
fn word_atsource
forall C, 'k where ReadBytes[C, Str['k]].
fn word_at(&cx: C, bytes: Str['k], start: usize) -> Option[(Str['k], usize)] { ... }
The next whitespace-separated word at or after start, and where the search for the one after it starts; nothing when only whitespace is left.