Items available everywhere without having to use
them
This file is the similar to the Rust's "prelude", items defined here are available in the root lexical-scope, so they are available everywhere (but can be shadowed by local definitions).
In general, prelude should only contain use aliases to items defined elsewhere.
Builtin types
Unit type (
()
)
Boolean type
8-bit unsigned integer (byte)
16-bit unsigned integer
32-bit unsigned integer
64-bit unsigned integer
128-bit unsigned integer
Native unsigned integer (machine word)
Signed 8-bit integer
Signed 16-bit integer
Signed 32-bit integer
Signed 64-bit integer
Signed 128-bit integer
Native signed integer (machine word)
Single precision floating point type
Double precision floating point type
Structs
A placeholder for the
Self
type in the protocol of a dyn
object.
Coroutine object
Optional value
Either a success value or an error value.
Macros
Ungracefully terminate the thread or process with an error message.
Prints a formatted string to standard output.
Causes the compilation to fail if reached.
Extract the success value or short-circuit the calling function.
Prints a formatted string to standard output with newline.
Prints a formatted string to standard error.
Panics if
cond
evaluates to false.
Prints a formatted string to standard error with newline.
Panics if
lhs
and rhs
are not equal.
Panics if
lhs
and rhs
are equal.
Treats the location as unreachable during program flow.
A helper for printing a value of a subexpression for debugging purposes.