Skip to main content

Module prelude

Module prelude 

Source
Expand description

Frequently-used types that are available on all platforms

We need to reexport the core types so this works with rust-dep-of-std.

ModulesΒ§

fmt πŸ”’
Utilities for formatting and printing strings.
hash πŸ”’
Generic hashing support.
iter πŸ”’
Composable external iteration.
mem πŸ”’
Basic functions for dealing with memory, values, and types.
panic πŸ”’
Panic support in the standard library.
ptr πŸ”’
Manually manage memory through raw pointers.

MacrosΒ§

assert πŸ”’
Asserts that a boolean expression is true at runtime.
cfg πŸ”’
Evaluates boolean combinations of configuration flags at compile-time.
compile_error πŸ”’
Causes compilation to fail with the given error message when encountered.
debug_assert πŸ”’
Asserts that a boolean expression is true at runtime.
panic πŸ”’
Panics the current thread.
unimplemented πŸ”’
Indicates unimplemented code by panicking with a message of β€œnot implemented”.

EnumsΒ§

Option πŸ”’
The Option type. See the module level documentation for more.
c_void πŸ”’
Equivalent to C’s void type when used as a pointer.

TraitsΒ§

Clone πŸ”’
A common trait that allows explicit creation of a duplicate value.
Copy πŸ”’
Types whose values can be duplicated simply by copying bits.
Debug πŸ”’
? formatting.
Default πŸ”’
A trait for giving a type a useful default value.
Eq πŸ”’
Trait for comparisons corresponding to equivalence relations.
Iterator πŸ”’
A trait for dealing with iterators.
PartialEq πŸ”’
Trait for comparisons using the equality operator.
Send πŸ”’
Types that can be transferred across thread boundaries.
Sync πŸ”’
Types for which it is safe to share references between threads.

FunctionsΒ§

align_of πŸ”’
Returns the ABI-required minimum alignment of a type in bytes.
align_of_val πŸ”’
Returns the ABI-required minimum alignment of the type of the value that val points to in bytes.
size_of πŸ”’
Returns the size of a type in bytes.
size_of_val πŸ”’
Returns the size of the pointed-to value in bytes.

Type AliasesΒ§

c_char πŸ”’
Equivalent to C’s char type.
c_double πŸ”’
Equivalent to C’s double type.
c_float πŸ”’
Equivalent to C’s float type.
c_int πŸ”’
Equivalent to C’s signed int (int) type.
c_long πŸ”’
Equivalent to C’s signed long (long) type.
c_longlong πŸ”’
Equivalent to C’s signed long long (long long) type.
c_short πŸ”’
Equivalent to C’s signed short (short) type.
c_uchar πŸ”’
Equivalent to C’s unsigned char type.
c_uint πŸ”’
Equivalent to C’s unsigned int type.
c_ulong πŸ”’
Equivalent to C’s unsigned long type.
c_ulonglong πŸ”’
Equivalent to C’s unsigned long long type.
c_ushort πŸ”’
Equivalent to C’s unsigned short type.

Attribute MacrosΒ§

derive πŸ”’
Attribute macro used to apply derive macros.

Derive MacrosΒ§

Clone πŸ”’
Derive macro generating an impl of the trait Clone.
Copy πŸ”’
Derive macro generating an impl of the trait Copy.
Debug πŸ”’
Derive macro generating an impl of the trait Debug.
Default πŸ”’
Derive macro generating an impl of the trait Default.
Eq πŸ”’
Derive macro generating an impl of the trait Eq. The behavior of this macro is described in detail here.
PartialEq πŸ”’
Derive macro generating an impl of the trait PartialEq. The behavior of this macro is described in detail here.