Module prelude

Source
Expand description

Prelude for async utilities for use in web applications.

This includes all the imports from kvarn_utils::prelude. It also imports async-related std items and the common tokio items.

Re-exports§

pub use kvarn_utils as utils;

Modules§

bytes
Provides abstractions for working with bytes.
chars
Common characters expressed as a single byte each, according to UTF-8.
compact_str

compact_str

A memory efficient string type that can store up to 24* bytes on the stack.

extensions
Parsing utilities and constants for Kvarn extensions.
fmt
Utilities for formatting and printing Strings.
header
HTTP header types
io
Traits, helpers, and type definitions for core I/O functionality.
net
Networking primitives for TCP/UDP communication.
parse
General parsing complying to the HTTP standards.
str
Utilities for the str primitive type.
uri
URI component of request and response lines

Macros§

build_bytes
Convenience macro to create a Bytes from multiple &[u8] sources.
debug
Logs a message at the debug level.
error
Logs a message at the error level.
format_compact
Creates a CompactString using interpolation of runtime expressions.
info
Logs a message at the info level.
log
The standard logging macro.
trace
Logs a message at the trace level.
warn
Logs a message at the warn level.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
BytesMut
A unique reference to a contiguous slice of memory.
CompactString
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
Context
The context of an asynchronous task.
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Formatter
Configuration for formatting.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HeaderMap
A set of HTTP headers
HeaderName
Represents an HTTP header field name
HeaderValue
Represents an HTTP header field value.
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
Method
The Request Method (VERB)
Mutex
An asynchronous Mutex-like type.
Path
A slice of a path (akin to str).
PathBuf
An owned, mutable path (akin to String).
Pin
A pointer which pins its pointee in place.
ReadBuf
A wrapper around a byte buffer that is incrementally filled and initialized.
Request
Represents an HTTP request.
Response
Represents an HTTP response
RwLock
An asynchronous reader-writer lock.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Uri
The URI component of a request.
Version
Represents a version of the HTTP spec.
WriteableBytes
A writeable Bytes.

Enums§

Cow
A clone-on-write smart pointer.
IpAddr
An IP address, either IPv4 or IPv6.
Poll
Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.
SocketAddr
An internet socket address, either IPv4 or IPv6.

Traits§

AsCleanDebug
Trait to enable .as_clean to get a CleanDebug for the variable.
AsyncRead
Reads bytes from a source.
AsyncReadExt
Reads bytes from a source.
AsyncWrite
Writes bytes asynchronously.
AsyncWriteExt
Writes bytes to a sink.
BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
Debug
? formatting.
Display
Format trait for an empty format, {}.
Future
A future represents an asynchronous computation, commonly obtained by use of async.
Ord
Trait for types that form a total order.
PartialOrd
Trait for types that form a partial order.
Read
The Read trait allows for reading bytes from a source.
Seek
The Seek trait provides a cursor which can be moved within a stream of bytes.
ToCompactString
A trait for converting a value to a CompactString.
TryFrom
Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of TryInto.
Write
A trait for objects which are byte-oriented sinks.

Derive Macros§

Debug
Derive macro generating an impl of the trait Debug.
Ord
Derive macro generating an impl of the trait Ord. The behavior of this macro is described in detail here.
PartialOrd
Derive macro generating an impl of the trait PartialOrd. The behavior of this macro is described in detail here.