Expand description
Miscellaneous utilities that are used by Shadow.
Modules§
- byte_
queue - callback_
queue - An event/listener framework to allow listeners to subscribe to event sources.
- childpid_
watcher - counter
- A counter that can be used to count frequencies of a set of objects. The counter starts with no keys. When an unknown key is incremented, the counter adds a new key to an internal map and sets the count for that key to 1. When a known key is incremented, the count for that key increases. The state of the counter can be extracted by converting it to a string, which lists the counts for all keys sorted with the heaviest hitters first. Currently, only String types are supported, but we may eventually support counting generic types.
- enum_
passthrough - give
- interval_
map - legacy_
callback_ queue - macros
- once_
set - pcap_
writer - perf_
timer - proc_
maps - shm_
cleanup - sockaddr
- status_
bar - stream_
len - syscall
- units
- Types for parsing/deserializing unit values.
Structs§
- Host
Tree Pointer - A pointer to an object that is safe to dereference from any thread, if the Host lock for the specified host is held.
- Magic
- Runtime memory error checking to help catch errors that C code is prone to. Can probably drop once C interop is removed.
- Object
Counter - Helper for tracking the number of allocated objects.
Enums§
Traits§
- IsSend
- A trait we can use as a compile-time check to make sure that an object is Send.
- IsSync
- A trait we can use as a compile-time check to make sure that an object is Sync.
Functions§
- case_
insensitive_ eq - Returns
true
ifeq_ignore_ascii_case
returnstrue
on allu8
ascii pairs. Should only be used for ascii byte strings. - copy_
dir_ all - Copy the contents of the
src
directory to a new directory nameddst
. Permissions will be preserved. - debug_
assert_ cloexec - If debug assertions are enabled, panics if
FD_CLOEXEC
is not set onfile
. - i8_
to_ u8_ slice - Convert a
&[i8]
to&[u8]
. Useful when interacting with C strings. Panics ifu8::try_from(c)
fails for anyc
in the slice. - inject_
preloads - Inject
injected_preloads
into the environmentenvv
. - pathbuf_
to_ nul_ term_ cstring - Helper for converting a PathBuf to a CString
- return_
code_ for_ signal - Get the return code for a process that exited by the given signal, following the behaviour of bash.
- tilde_
expansion - u8_
to_ i8_ slice - Convert a
&[u8]
to&[i8]
. Useful when interacting with C strings. Panics ifi8::try_from(c)
fails for anyc
in the slice. - verify_
plugin_ path - Check that the plugin path is executable under Shadow.