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_strA 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
strprimitive type.- uri
- URI component of request and response lines
Macros§
- build_
bytes - Convenience macro to create a
Bytesfrom multiple&[u8]sources. - debug
- Logs a message at the debug level.
- error
- Logs a message at the error level.
- format_
compact - Creates a
CompactStringusing 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.
- Bytes
Mut - A unique reference to a contiguous slice of memory.
- Compact
String - A
CompactStringis a compact string type that can be used almost anywhere aStringorstrcan be used. - Context
- The context of an asynchronous task.
- Duration
- A
Durationtype 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.
- Header
Map - A set of HTTP headers
- Header
Name - Represents an HTTP header field name
- Header
Value - 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.
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Uri
- The URI component of a request.
- Version
- Represents a version of the HTTP spec.
- Writeable
Bytes - 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.
- Socket
Addr - An internet socket address, either IPv4 or IPv6.
Traits§
- AsClean
Debug - Trait to enable
.as_cleanto get aCleanDebugfor the variable. - Async
Read - Reads bytes from a source.
- Async
Read Ext - Reads bytes from a source.
- Async
Write - Writes bytes asynchronously.
- Async
Write Ext - Writes bytes to a sink.
- BufRead
- A
BufReadis a type ofReader 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.
- Partial
Ord - Trait for types that form a partial order.
- Read
- The
Readtrait allows for reading bytes from a source. - Seek
- The
Seektrait provides a cursor which can be moved within a stream of bytes. - ToCompact
String - 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. - Partial
Ord - Derive macro generating an impl of the trait
PartialOrd. The behavior of this macro is described in detail here.