🔬This is a nightly-only experimental API. (
prelude_future
)Expand description
The Future version of the prelude of The Rust Standard Library.
See the module-level documentation for more.
Macros§
- assert
Experimental - Asserts that a boolean expression is
true
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 Deprecated 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 as
format_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.
Structs§
- Box
Experimental - A pointer type that uniquely owns a heap allocation of type
T
. - String
Experimental - A UTF-8–encoded, growable string.
- Vec
Experimental - A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Enums§
- Option
Experimental - The
Option
type. See the module level documentation for more. - Result
Experimental Result
is a type that represents either success (Ok
) or failure (Err
).
Traits§
- AsMut
Experimental - Used to do a cheap mutable-to-mutable reference conversion.
- AsRef
Experimental - Used to do a cheap reference-to-reference conversion.
- AsyncFn
Experimental - An async-aware version of the
Fn
trait. - Async
FnMut Experimental - An async-aware version of the
FnMut
trait. - Async
FnOnce Experimental - An async-aware version of the
FnOnce
trait. - 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 of
Into
. - From
Iterator Experimental - Conversion from an
Iterator
. - Future
Experimental - A future represents an asynchronous computation obtained by use of
async
. - Into
Experimental - A value-to-value conversion that consumes the input value. The
opposite of
From
. - Into
Future Experimental - Conversion into a
Future
. - Into
Iterator Experimental - Conversion into an
Iterator
. - 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.
- ToOwned
Experimental - A generalization of
Clone
to borrowed data. - ToString
Experimental - A trait for converting a value to a
String
. - TryFrom
Experimental - Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of
TryInto
. - TryInto
Experimental - An attempted conversion that consumes
self
, 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 that
val
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. - define_
opaque Experimental - Provide a list of type aliases and other opaque-type-containing type definitions to an item with a body. This list will be used in that body to define opaque types’ hidden types. Can only be applied to things that have bodies.
- 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 trait
Clone
. - Copy
Experimental - Derive macro generating an impl of the trait
Copy
. - Debug
Experimental - Derive macro generating an impl of the trait
Debug
. - Default
Experimental - Derive macro generating an impl of the trait
Default
. - Eq
Experimental - Derive macro generating an impl of the trait
Eq
. - Hash
Experimental - Derive macro generating an impl of the trait
Hash
. - Ord
Experimental - Derive macro generating an impl of the trait
Ord
. The behavior of this macro is described in detail here. - Partial
Eq Experimental - Derive macro generating an impl of the trait
PartialEq
. The behavior of this macro is described in detail here. - Partial
Ord Experimental - Derive macro generating an impl of the trait
PartialOrd
. The behavior of this macro is described in detail here.