Module util

Module util 

Source

Enums§

ParseError

Functions§

code_color
colours an HTTP code appropriately
escape_html
Performs html escaping on str
is_param_name_valid
Accepts a string which is assumed to be a param name. Returns true if it’s valid, valse if it’s not valid.
parse_header
Parses an arbitrary string slice containing an unparsed header straight from the request recieve buffer.
parse_parameters
Parses an HTTP query string into a key-value hashmap Note: Assumes there will be no whitespace characters.
split_once
Find the index of the first item by, and return a tuple of two mutable string slices
strip_for_terminal
Accept a string, filter out the terminal control chars and return the clean string
url_decode
Accept a string, perform URL decoding on the string and return the result