Skip to main content

Module wc

Module wc 

Source

Structs§

WcCounts
Results from counting a byte slice.

Functions§

count_all
Count everything in a single pass for maximum efficiency. When multiple flags are requested, this avoids re-scanning.
count_bytes
Count bytes. Trivial but included for API consistency.
count_chars
Count UTF-8 characters. Invalid sequences count each byte as one character, matching GNU wc -m behavior in C locale.
count_lines
Count newlines using SIMD-accelerated memchr. GNU wc counts newline bytes, not logical lines.
count_words
Count words: a word is a maximal sequence of non-whitespace bytes. Matches GNU wc behavior using isspace() from C locale.
max_line_length
Compute max display width of any line. A “line” is delimited by newline. Width is byte count for C locale. GNU wc -L in C/POSIX locale counts bytes per line (not display width).