Crate gstuff [] [src]

Macros

ERR

Returns a Err(String), prepending the current location (file name and line number) to the string.

ERRL

Prepends file name and line number to the given message.

find_parse_replace_s

Uses nom to find all matches of the given $submac parser and replace them with the parser's evaluations.

gstring

A helper to build a string on the stack.

parse_replace_s

Uses nom to find all matches of the given $submac parser and replace them with the $submac results.

take_until_find_parse_s

$starts is an optional Pattern used to optimize the $remainder search.

take_until_parse_s

Implements the /(?x) (.*?) (remainder)/ pattern: looks for remainder first, then returns a tuple with the prefix and the remainder.

try_f

Returns on error, prepending the current location to a stringified error, then passing the string to From::from.

try_s

Returns on error, converting the Err value to String and prepending the current location.

try_sp

Structs

ISATTY

True if the standard output is a terminal.

Functions

any_to_str

Useful with panic handlers.

cmd

Run a command, printing it first. Stdout and stderr are forwarded through (inherit).

filename

Shortcut to path->filename conversion.

netstring

Takes a netstring from the front of the slice.

slurp

Read contents of the file into a String.

slurp_prog

Runs a command in a shell, returning stderr+stdout on success.

status_line

Clears the line to the right, prints the given text, moves the caret all the way to the left.

status_line_clear

Clears the status line ff stdout isatty and status_line isn't empty.

with_hostname

Wraps gethostname to fetch the current hostname into a temporary buffer.

with_status_line

Clear the status line, run the code, then restore the status line.