🔬This is a nightly-only experimental API. (
prelude_2024
)Expand description
The 2024 version of the core prelude.
See the module-level documentation for more.
Macros§
- assert
Experimental Asserts that a boolean expression istrue
at runtime. - cfg
Experimental Evaluates boolean combinations of configuration flags at compile-time. - column
Experimental Expands to the column number at which it was invoked. - compile_
error Experimental Causes compilation to fail with the given error message when encountered. - concat
Experimental Concatenates literals into a static string slice. - concat_
bytes Experimental Concatenates literals into a byte slice. - concat_
idents Experimental Concatenates identifiers into one identifier. - deref
Experimental Unstable placeholder for deref patterns. - env
Experimental Inspects an environment variable at compile time. - file
Experimental Expands to the file name in which it was invoked. - format_
args Experimental Constructs parameters for the other string-formatting macros. - format_
args_ nl Experimental Same asformat_args
, but adds a newline in the end. - include
Experimental Parses a file as an expression or an item according to the context. - include_
bytes Experimental Includes a file as a reference to a byte array. - include_
str Experimental Includes a UTF-8 encoded file as a string. - line
Experimental Expands to the line number on which it was invoked. - log_
syntax Experimental Prints passed tokens into the standard output. - module_
path Experimental Expands to a string that represents the current module path. - option_
env Experimental Optionally inspects an environment variable at compile time. - stringify
Experimental Stringifies its arguments. - trace_
macros Experimental Enables or disables tracing functionality used for debugging other macros. - type_
ascribe Experimental Unstable placeholder for type ascription.
Enums§
- Option
Experimental TheOption
type. See the module level documentation for more. - Result
Experimental
Traits§
- AsMut
Experimental Used to do a cheap mutable-to-mutable reference conversion. - AsRef
Experimental Used to do a cheap reference-to-reference conversion. - Clone
Experimental A common trait for the ability to explicitly duplicate an object. - Copy
Experimental Types whose values can be duplicated simply by copying bits. - Default
Experimental A trait for giving a type a useful default value. - Double
Ended Iterator Experimental An iterator able to yield elements from both ends. - Drop
Experimental Custom code within the destructor. - Eq
Experimental Trait for comparisons corresponding to equivalence relations. - Exact
Size Iterator Experimental An iterator that knows its exact length. - Extend
Experimental Extend a collection with the contents of an iterator. - Fn
Experimental The version of the call operator that takes an immutable receiver. - FnMut
Experimental The version of the call operator that takes a mutable receiver. - FnOnce
Experimental The version of the call operator that takes a by-value receiver. - From
Experimental Used to do value-to-value conversions while consuming the input value. It is the reciprocal ofInto
. - From
Iterator Experimental Conversion from anIterator
. - Future
Experimental A future represents an asynchronous computation obtained by use ofasync
. - Into
Experimental A value-to-value conversion that consumes the input value. The opposite ofFrom
. - Into
Future Experimental Conversion into aFuture
. - Into
Iterator Experimental Conversion into anIterator
. - Iterator
Experimental A trait for dealing with iterators. - Ord
Experimental Trait for types that form a total order. - Partial
Eq Experimental Trait for comparisons using the equality operator. - Partial
Ord Experimental Trait for types that form a partial order. - Send
Experimental Types that can be transferred across thread boundaries. - Sized
Experimental Types with a constant size known at compile time. - Sync
Experimental Types for which it is safe to share references between threads. - TryFrom
Experimental Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal ofTryInto
. - TryInto
Experimental An attempted conversion that consumesself
, which may or may not be expensive. - Unpin
Experimental Types that do not require any pinning guarantees.
Functions§
- align_
of Experimental Returns the ABI-required minimum alignment of a type in bytes. - align_
of_ val Experimental Returns the ABI-required minimum alignment of the type of the value thatval
points to in bytes. - drop
Experimental Disposes of a value. - size_of
Experimental Returns the size of a type in bytes. - size_
of_ val Experimental Returns the size of the pointed-to value in bytes.
Attribute Macros§
- alloc_
error_ handler Experimental Attribute macro applied to a function to register it as a handler for allocation failure. - bench
Experimental Attribute macro applied to a function to turn it into a benchmark test. - cfg_
accessible Experimental Keeps the item it’s applied to if the passed path is accessible, and removes it otherwise. - cfg_
eval Experimental Expands all#[cfg]
and#[cfg_attr]
attributes in the code fragment it’s applied to. - derive
Experimental Attribute macro used to apply derive macros. - derive_
const Experimental Attribute macro used to apply derive macros for implementing traits in a const context. - global_
allocator Experimental Attribute macro applied to a static to register it as a global allocator. - test
Experimental Attribute macro applied to a function to turn it into a unit test. - test_
case Experimental An implementation detail of the#[test]
and#[bench]
macros.
Derive Macros§
- Clone
Experimental Derive macro generating an impl of the traitClone
. - Copy
Experimental Derive macro generating an impl of the traitCopy
. - Debug
Experimental Derive macro generating an impl of the traitDebug
. - Default
Experimental Derive macro generating an impl of the traitDefault
. - Eq
Experimental Derive macro generating an impl of the traitEq
. - Hash
Experimental Derive macro generating an impl of the traitHash
. - Ord
Experimental - Partial
Eq Experimental - Partial
Ord Experimental Derive macro generating an impl of the traitPartialOrd
. The behavior of this macro is described in detail here.