Expand description
The prelude.
Re-exports§
pub use futures_lite as futures;pub use fxhash;pub use hashbrown;pub use parking_lot;
Modules§
- alloc
- The Rust core allocation and collections library
- prelude
- Convenience re-export of common traits, structs and utils.
- rng
- A fast but not cryptographically secure PRNG based on Wyrand.
Macros§
Structs§
- Drain
- An iterator that removes the items from a
SmallVecand yields them by value. - Into
Iter - An iterator that consumes a
SmallVecand yields its items by value. - Labeled
Id - A
Ulidwith a human-readable ascii prefix. - Small
Vec - A
Vec-like container that can store a small number of elements inline. - Ulid
- A Ulid is a unique 128-bit lexicographically sortable identifier
- Ustr
- A handle representing a string in the global string cache.
Enums§
- Collection
Alloc Err - Error type for APIs with fallible heap allocation
- Labeled
IdCreate Error - Error creating a
LabeledId. - Labled
IdParse Error - Errors that can happen while parsing a
LabeledId. - Maybe
Owned - This type provides a way to store data to which you either have a reference to or which you do own.
- Maybe
Owned Mut - This type is basically the same as
MaybeOwned, but works with mutable references. - Turbo
Kind - Enum for determining the kind of PRNG, whether a fast one, or a slow, possibly crypographically secure one.
Constants§
- THREAD_
RNG - A fast, non-cryptographic, thread-local random number generator powered by turborand.
Traits§
- Array
- Types that can be used as the backing store for a
SmallVec. - Forkable
Core - Trait for enabling creating new
TurboCoreinstances from an original instance. Similar to cloning, except forking modifies the state of the original instance in order to provide a new, random state for the forked instance. This allows for creating many randomised instances from a single seed in a deterministic manner. - GenCore
- This trait provides the means to easily generate all integer types, provided
the main method underpinning this is implemented:
GenCore::gen. Once implemented, the rest of the trait provides default implementations for generating all integer types, though it is not recommended to override these. - Secure
Core - A marker trait to be applied to anything that implements
TurboCorein order to indicate that a PRNG source is cryptographically secure, so being a CSPRNG. - Seeded
Core - Trait for implementing Seedable PRNGs, requiring that the PRNG
implements
TurboCoreas a baseline. Seeds must beSizedin order to be used as the internal state of a PRNG. - ToSmall
Vec - Convenience trait for constructing a
SmallVec - Turbo
Core - Base trait for implementing a PRNG. Only one method must be
implemented:
TurboCore::fill_bytes, which provides the basis for any PRNG, to fill a buffer of bytes with random data. - Turbo
Rand - Extension trait for automatically implementing all
TurboRandmethods, as long as the struct implementsTurboCore&GenCore. All methods are provided as default implementations that build on top ofTurboCoreandGenCore, and thus are not recommended to be overridden, lest you potentially change the expected outcome of the methods. - UlidExt
- Extension trait for
Ulid.
Functions§
- default
- An ergonomic abbreviation for
Default::default()to make initializing structs easier. This is especially helpful when combined with “struct update syntax”. - get_
short_ name - Shortens a type name to remove all module paths.
- likely
- Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.
- unlikely
- Hints to the compiler that the branch condition is unlikely to be true. Returns the value passed to it.
- ustr
- Create a new Ustr from the given &str.
Type Aliases§
- HashMap
- A
HashMapimplementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - HashSet
- A
HashSetimplementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - UstrMap
- A standard
HashMapusingUstras the key type with a customHasherthat just uses the precomputed hash for speed instead of calculating it - UstrSet
- A standard
HashSetusingUstras the key type with a customHasherthat just uses the precomputed hash for speed instead of calculating it