Modules
Reason for having this is that neither
multiqueue
nor crossbeam_channel
implement UnwindSafe currently.Macros
Returns a
Err(String)
, prepending the current location (file name and line number) to the string.Prepends file name and line number to the given message.
Uses nom to find all matches of the given
$submac
parser and replace them with the parser’s evaluations.A helper to build a string on the stack.
Uses nom to find all matches of the given
$submac
parser and replace them with the $submac
results.$starts
is an optional Pattern
used to optimize the $remainder
search.Implements the
/(?x) (.*?) (remainder)/
pattern:
looks for remainder first, then returns a tuple with the prefix and the remainder.Returns on error, prepending the current location to a stringified error, then passing the string to
From::from
.Lifts an error into a boxed future.
Box<Future<Item=_, Error=_>>
.Lifts an error into a boxed future.
Box<Future<Item=_, Error=String>>
.Returns on error, converting the
Err
value to String
and prepending the current location.Like
try_s
, but takes a reference.Structs
Allows several threads or processes to compete for a shared resource by tracking resource ownership with a file.
If the lock file is older than
If the lock file is older than
ttl_sec
then it is removed, allowing us to recover from a thread or process dying while holding the lock.True if the standard output is a terminal.
Process entry in /proc.
Iterate over processes in /proc.
Functions
Useful with panic handlers.
Run a command, printing it first. Stdout and stderr are forwarded through (
inherit
).Converts the duration into a number of seconds with fractions.
Converts the duration into a number of milliseconds.
Shortcut to path->filename conversion.
Last-modified of the file in seconds since the UNIX epoch, with fractions.
Returns 0 if the file does not exists.
Returns 0 if the file does not exists.
Takes a netstring from the front of the slice.
The current number of seconds since UNIX epoch, with fractions.
The current number of milliseconds since UNIX epoch.
Read contents of the file into a
Vec
.Runs a command in a shell, returning stderr+stdout on success.
Clears the line to the right, prints the given text, moves the caret all the way to the left.
Clears the status line ff stdout
isatty
and status_line
isn’t empty.Wraps
gethostname
to fetch the current hostname into a temporary buffer.Clear the status line, run the code, then restore the status line.