Expand description
Utility functions for web application development.
This includes
- commonly used
chars, - a
build_bytesmacro to create aBytesfrom bytes slices with one allocation, WriteableBytesto optimize performance when creating a newBytesof unknown length,hardcoded_error_bodyto get a hard-coded error response.CleanDebugand it’s traitAsCleanDebugto get aDebugimplementation wired to the item’sDisplayimplementation.
Modules§
- Parsing utilities and constants for Kvarn extensions.
- General parsing complying to the HTTP standards.
- The prelude for common web application utilities.
Macros§
- Convenience macro to create a
Bytesfrom multiple&[u8]sources. - Stringify $field on $self. This only returns the field name. This is constructed to make your IDE recognize the input as the actual field. This means renaming is applied to the string returned from this when you rename a field in your IDE.
fmt_field!but multiple.- Return stringified representation of
$item. This uses similar techniques toident_str!. - Tests if the first arguments starts with any of the following.
Structs§
- Critical components from request to apply to response.
- The arguments and name of a single
Presentextension. - An iterator of
strfor the arguments inPresentArguments - The
Presentextensions parsed from a file containing them. - An iterator of
PresentArgumentsfromPresentExtensions - Iterator for
quoted_str_split. Returns owned strings. - A pair of a value string and a quality of said value.
- A writeable
Bytes.
Enums§
Traits§
- Trait to enable
.as_cleanto get aCleanDebugfor the variable.
Functions§
- Clones a
Request, discarding the body. - Clones a
Response, discarding the body. - Gets the body length from the
Request::headersofrequest. - Gets the body length of a
response. - Get a hardcoded error message.
- Checks the equality of value of
nameinheadersandvalue. Value does not need to be all lowercase; the equality operation ignores the cases. - Checks
byteif it’s a valid byte forHeaderValues. - Joins the items in
iterwith aseparatorusing 1 allocation. - Parses a header with a value-quality list of pairs.
- Makes a
PathBufusing one allocation. - Does a response of type
methodhave a body? - Decodes the URI encoding.
- Shell-like splitting of
s. - Removes all headers from
headerswithname. - Sanitizes
requestfor unwanted data and returns critical components. - Sets the
content-lengthofheaderstolen. - Check if
bytesstarts with a validMethod. - Checks if
bytesstarts with a validVersion