Skip to main content

Module util

Module util 

Source
Expand description

Common byte, collection, future, and service utilities.

Modules§

buffer
Service that buffers incoming requests.
hash_map
A hash map implemented with quadratic probing and SIMD lookup.
hash_set
A hash set implemented as a HashMap where the value is ().
inflight
Middleware for limiting concurrent service calls.
keepalive
onerequest
Middleware that permits one service call at a time.
retry
timeout
Service that applies a timeout to requests.

Structs§

BytePage
A contiguous chunk stored by BytePages.
BytePages
A growable sequence of byte pages.
ByteString
An immutable UTF-8 string backed by Bytes.
Bytes
A reference counted contiguous slice of memory.
BytesMut
A unique reference to a contiguous slice of memory.
Counter
A shared count with an asynchronous capacity notification.
CounterGuard
An acquired counter slot.
ErrorMessage
A lightweight owned error message.
ErrorMessageChained
An owned error message with an optional source error.
Extensions
A type map of request extensions.
Lazy
Future for the lazy function.
OnDropFn
Runs a callback when this guard is dropped.
OnDropFuture
Future wrapper that runs a callback if dropped before completion.

Enums§

BytePageSize
Capacity category used when allocating crate::BytePage storage.
Either
A value of one of two types.

Traits§

Buf
Read bytes from a buffer.
BufMut
A trait for values that provide sequential write access to bytes.
Equivalent
Key equivalence trait.
OnDropFutureExt
Extension trait for running a callback when a pending future is dropped.
Stream
A stream of values produced asynchronously.
TryFuture
A convenience for futures that return Result values that includes a variety of adapters tailored to such futures.

Functions§

clone_io_error
Clones an I/O error’s kind and message.
dyn_err
Boxes an error as a dynamically dispatched error.
dyn_rc_err
Wraps an error in a reference-counted, dynamically dispatched error.
fmt_err
Writes an error and its source chain.
fmt_err_string
Formats an error and its source chain into a string.
join
Future for the join combinator, waiting for two futures to complete.
join_all
Creates a future which represents a collection of the outputs of the futures given.
lazy
Creates a new future that allows delayed execution of a closure.
select
Waits for either one of two differently-typed futures to complete.
str_rc_err
Converts a string into a reference-counted error.
stream_recv
Waits for and returns the next item from a stream.

Type Aliases§

BoxFuture
An owned, dynamically dispatched future.
HashMap
A hash map using ntex’s fast, randomly seeded hash state.
HashRandomState
The hash state used by HashMap and HashSet.
HashSet
A hash set using ntex’s fast, randomly seeded hash state.