Expand description
The gstd
default prelude. Re-imports default std
modules and traits.
std
can be safely replaced to gstd
in the Rust programs.
Re-exports
pub use scale_info;
pub use scale_info::scale as codec;
Modules
- Utilities for dynamic typing or type reflection.
- A module for working with borrowed data.
- The
Box<T>
type for heap allocation. - Shareable mutable containers.
- The
Clone
trait for types that cannot be ‘implicitly copied’. - Utilities for comparing and ordering values.
- Collection types.
- Traits for conversions between types.
- The
Default
trait for types with a default value. - Utilities for formatting and printing
String
s. - Asynchronous basic functionality.
- Generic hashing support.
- Hints to compiler that affects how code should be emitted or optimized. Hints may be compile time or runtime.
- Composable external iteration.
- Primitive traits and types representing basic properties of types.
- Basic functions for dealing with memory.
- Overloadable operators.
- Types that pin data to its location in memory.
- Manually manage memory through raw pointers.
- Single-threaded reference-counting pointers. ‘Rc’ stands for ‘Reference Counted’.
- Utilities for the slice primitive type.
- A UTF-8–encoded, growable string.
- A contiguous growable array type with heap-allocated contents, written
Vec<T>
.
Macros
- concat_bytesExperimentalConcatenates literals into a byte slice.
- concat_identsExperimentalConcatenates identifiers into one identifier.
- format_args_nlExperimentalSame as
format_args
, but adds a newline in the end. - log_syntaxExperimentalPrints passed tokens into the standard output.
- trace_macrosExperimentalEnables or disables tracing functionality used for debugging other macros.
- type_ascribeExperimentalUnstable placeholder for type ascription.
- Asserts that a boolean expression is
true
at runtime. - Evaluates boolean combinations of configuration flags at compile-time.
- Expands to the column number at which it was invoked.
- Causes compilation to fail with the given error message when encountered.
- Concatenates literals into a static string slice.
- Inspects an environment variable at compile time.
- Expands to the file name in which it was invoked.
- Creates a
String
using interpolation of runtime expressions. - Constructs parameters for the other string-formatting macros.
- Parses a file as an expression or an item according to the context.
- Includes a file as a reference to a byte array.
- Includes a UTF-8 encoded file as a string.
- Expands to the line number on which it was invoked.
- Expands to a string that represents the current module path.
- Optionally inspects an environment variable at compile time.
- Stringifies its arguments.
- Creates a
Vec
containing the arguments.
Structs
- An ordered map based on a B-Tree.
- An ordered set based on a B-Tree.
- A pointer type that uniquely owns a heap allocation of type
T
. - A hash map implemented with quadratic probing and SIMD lookup.
- A UTF-8–encoded, growable string.
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’. - A double-ended queue implemented with a growable ring buffer.
Enums
- The
Option
type. See the module level documentation for more.
Traits
- Used to do a cheap mutable-to-mutable reference conversion.
- Used to do a cheap reference-to-reference conversion.
- A common trait for the ability to explicitly duplicate an object.
- Types whose values can be duplicated simply by copying bits.
- Trait that allows zero-copy read of value-references from slices in LE format.
- A trait for giving a type a useful default value.
- An iterator able to yield elements from both ends.
- Custom code within the destructor.
- Trait that allows zero-copy write of value-references to slices in LE format.
- Trait for equality comparisons which are equivalence relations.
- An iterator that knows its exact length.
- Extend a collection with the contents of an iterator.
- The version of the call operator that takes an immutable receiver.
- The version of the call operator that takes a mutable receiver.
- The version of the call operator that takes a by-value receiver.
- Used to do value-to-value conversions while consuming the input value. It is the reciprocal of
Into
. - Parse a value from a string
- A value-to-value conversion that consumes the input value. The opposite of
From
. - Conversion into an
Iterator
. - A trait for dealing with iterators.
- Trait for types that form a total order.
- Trait for equality comparisons.
- Trait for types that form a partial order.
- Types that can be transferred across thread boundaries.
- Types with a constant size known at compile time.
- Types for which it is safe to share references between threads.
- A generalization of
Clone
to borrowed data. - A trait for converting a value to a
String
. - An attempted conversion that consumes
self
, which may or may not be expensive. - Implementors return their meta type information.
- Types that can be safely moved after being pinned.
Functions
- Disposes of a value.
Attribute Macros
- benchExperimentalAttribute macro applied to a function to turn it into a benchmark test.
- cfg_accessibleExperimentalKeeps the item it’s applied to if the passed path is accessible, and removes it otherwise.
- cfg_evalExperimentalExpands all
#[cfg]
and#[cfg_attr]
attributes in the code fragment it’s applied to. - derive_constExperimentalAttribute macro used to apply derive macros for implementing traits in a const context.
- test_caseExperimentalAn implementation detail of the
#[test]
and#[bench]
macros. - Attribute macro used to apply derive macros.
- Attribute macro applied to a static to register it as a global allocator.
- Attribute macro applied to a function to turn it into a unit test.
Derive Macros
- Derive macro generating an impl of the trait
Clone
. - Derive macro generating an impl of the trait
Copy
. - Derive macro generating an impl of the trait
Debug
. - Derive
parity_scale_codec::Decode
and for struct and enum. - Derive macro generating an impl of the trait
Default
. - Derive
parity_scale_codec::Encode
andparity_scale_codec::EncodeLike
for struct and enum. - Derive macro generating an impl of the trait
Eq
. - Derive macro generating an impl of the trait
Hash
. - Derive macro generating an impl of the trait
PartialOrd
. The behavior of this macro is described in detail here.