Expand description
library ~ (core/bundler file)
Re-exports§
pub extern crate libc;
Modules§
- backup_
control - Implement GNU-style backup functionality.
- buf_
copy - This module provides several buffer-based copy/write functions that leverage
the
splicesystem call in Linux systems, thus increasing the I/O performance of copying between two file descriptors. This module is mostly used by utilities to work around the limitations of Rust’sfs::copywhich does not handle copying special files (e.g pipes, character/block devices). - checksum
- clap_
localization - Helper clap functions to localize error handling and options
- colors
- Provides color handling for
lsand other utilities. - display
- Utilities for printing paths, with special attention paid to special characters and invalid unicode.
- encoding
- entries
- Get password/group file entry
- error
- All utils return exit with an exit code. Usually, the following scheme is used:
- extendedbigdecimal
- An arbitrary precision float that can also represent infinity, NaN, etc.
- fast_
inc - format
printf-style formatting- fs
- Set of functions to manage regular files, special files, and links.
- fsext
- Set of functions to manage file systems
- fsxattr
- Set of functions to manage xattr on files and dirs
- i18n
- io
- Encapsulates differences between OSs regarding the access to file handles / descriptors. This is useful when dealing with lower level stdin/stdout access.
- line_
ending - Provides consistent newline/zero terminator handling for
-z/--zeroflags. - lines
- Iterate over lines, including the line ending character(s).
- locale
- mode
- Set of functions to parse modes
- os
- Test if the program is running under WSL ref: https://github.com/microsoft/WSL/issues/4555 @@ https://archive.is/dP0bz
- panic
- Custom panic hooks that allow silencing certain types of errors.
- parser
- perms
- Common functions to manage permissions
- pipes
- Thin pipe-related wrappers around functions from the
nixcrate. - posix
- Iterate over lines, including the line ending character(s).
- process
- quoting_
style - Set of functions for escaping names according to different quoting styles.
- ranges
- A module for handling ranges of values.
- ringbuffer
- A fixed-size ring buffer.
- selinux
- Set of functions to manage SELinux security contexts
- signals
- This module provides a way to handle signals in a platform-independent way. It provides a way to convert signal names to their corresponding values and vice versa. It also provides a way to ignore the SIGINT signal and enable pipe errors.
- sum
- Implementations of digest functions, like md5 and sha1.
- systemd_
logind - Systemd-logind support for reading login records
- time
- Set of functions related to time handling
- update_
control - Implement GNU-style update functionality.
- uptime
- Provides functions to get system uptime, number of users and load average.
- utmpx
- Aims to provide platform-independent methods to obtain login records
- version_
cmp - Compare two version strings.
Macros§
- bin
- Execute utility code for
util. - crate_
version - Generate the version string for clap.
- has
- Used to check if the
modehas itspermbit set. - help_
about - Get the about text from the help file.
- help_
section - Reads a section from a file of the util as a
strliteral. - help_
usage - Get the usage from the help file.
- prompt_
yes - Prompt the user with a formatted string and returns
trueif they reply'y'or'Y' - show
- Display a
crate::error::UErrorand set global exit code. - show_
error - Show an error to stderr in a similar style to GNU coreutils.
- show_
if_ err - Display an error and set global exit code in error case.
- show_
warning - Print a warning message to stderr.
- show_
warning_ caps - Print a warning message to stderr, prepending the utility name.
- translate
- Macro for retrieving localized messages with optional arguments.
- uio_
error - Shorthand to construct
UIoError-instances.
Structs§
- Char
Byte Iterator - Iterates on the valid and invalid parts of a byte sequence with regard to the UTF-8 encoding.
- NonUtf8
OsStr Error
Enums§
- Char
Byte - Represent either a character or a byte. Used to iterate on partially valid UTF-8 data
Traits§
- Args
- Args contains arguments passed to the utility.
It is a trait that extends
Iterator<Item = OsString>. It provides utility functions to collect the arguments into aVec<String>. The collectedVec<String>can be lossy or ignore invalid encoding. - Into
Char Byte Iterator
Functions§
- args_os
- Returns an iterator over the command line arguments as
OsStrings. args_os() can be expensive to call - disable_
rust_ signal_ handlers - Disables the custom signal handlers installed by Rust for stack-overflow handling. With those custom signal handlers processes ignore the first SIGBUS and SIGSEGV signal they receive. See https://github.com/rust-lang/rust/blob/8ac1525e091d3db28e67adcbbd6db1e1deaa37fb/src/libstd/sys/unix/stack_overflow.rs#L71-L92 for details.
- execution_
phrase - Derive the complete execution phrase for “usage”.
- format_
usage - Generate the usage string for clap.
- get_
canonical_ util_ name - get_
utility_ is_ second_ arg - Used to check if the utility is the second argument.
Used to check if we were called as a multicall binary (
coreutils <utility>) - localized_
help_ template - Creates a localized help template for clap commands.
- localized_
help_ template_ with_ colors - Create a localized help template with explicit color control This ensures color detection consistency between clap and our template
- os_
str_ as_ bytes - Converts an
OsStrto a UTF-8&[u8]. - os_
str_ as_ bytes_ lossy - Performs a potentially lossy conversion from
OsStrto UTF-8 bytes. - os_
str_ from_ bytes - Converts a
&[u8]to an&OsStr, or parses it as UTF-8 into anOsStringon non-unix platforms. - os_
string_ from_ vec - Converts a
Vec<u8>into anOsString, parsing as UTF-8 on non-unix platforms. - os_
string_ to_ vec - Converts an
OsStringinto aVec<u8>, parsing as UTF-8 on non-unix platforms. - read_
byte_ lines - Equivalent to
std::BufRead::lineswhich outputs each line as aVec<u8>, which avoids panicking on non UTF-8 input. - read_
os_ string_ lines - Equivalent to
std::BufRead::lineswhich outputs each line as anOsStringThis won’t panic on non UTF-8 characters on Unix, but it still will on Windows. - read_
yes - Read a line from stdin and check whether the first character is
'y'or'Y' - set_
utility_ is_ second_ arg - Change the value of
UTILITY_IS_SECOND_ARGto true Used to specify that the utility is the second argument. - util_
name - Derive the utility name.
Attribute Macros§
- main
- A procedural macro to define the main function of a uutils binary.